Many cichlids will excavate and make pits in the substrate when they are breeding, this is to hide and protect the fry after they hatch. If you've ever seen footage of African cichlids in the wild, you will see a very good example of this. This behaviour is quite normal for not only are breeding pair, but single Oscars as well, I think it's just instinct. They probably find themselves doing it without actually knowing why they are doing it.
Giving the fish places to hide is very important. Rocks also have a very good surface for bacteria to grow on so this all helps control the toxins in your tank.