a hole in the floor to squat over

According to the AHD, it's from the phrase meaning to keep clothes. Any usage involving squatting over holes would be secondary offshhots of the main definition of a clothes closet.