What was the initial reason for a dugout being half buried?

Primarily so as not to obsruct the view of the game from the stands. An argument can also be made that it offers a bit of protection from line-drive fouls.