Most aquarists like to display some sort of substrate in their aquariums. It is decorative and it anchors live plants at the bottom of the tank. It also provides nutrients to aquatic plant roots and gives digging fish places to hide as well. Substrates also work as filters in under-gravel filtration units, depending on the type of substrates used.
Sand in an Aquarium
Sand starts out as a great substrate but after a while, the water pressure packs it down tight, which causes "dead" spots in the sand, where air can't get down through the layers. This means that the nutrients from the water won't leach down into the sand to be taken up through the roots of live plants. It also means that fish and aquatic animals that like to burrow and hide will have trouble doing so.
Gravel in an Aquarium
As long as gravel stones aren't too large and heavy, they are perfect for weighing down the roots of live plants. Too heavy and they crush the delicate roots. Too small and they are easily sucked up when vacuuming gravel. The perfect size for gravel is around the size of a pea. This size also helps prevent bottom scavengers such as goldfish, from getting gravel stones caught in their throats while rummaging around on the bottom.
Putting Them Together
Sand and gravel can be used together in aquariums, but if the gravel is put down first it will end up on top as the sand gradually settles to the bottom. Sand can't be used with gravel when using under-gravel filters as the motor won't be able to suck the water through both the gravel and the hard-packed sand. This means that the wastes won't be filtered out and will just sit there on the substrate.
Gravel and Sand Landscaping
Some aquarists like to decoratively landscape their tanks using both gravel and sand, but they typically put the two types of substrate in different locations of the tank. This is fine as long as the sand isn't so fine that its surface constantly sends up dust into the water, which quickly clogs filters. Also, the sand should be raked every so often so it can't settle into a hard pack of mud on the bottom.