Partly a regional preference thing - what most houses in an area have, all tend to have, by forcde of habit.
In much of Texas and almost all of Colorado snow loads are a consideration, so most roofs are peaked - air conditioners on sloped roofs make no sense, so they go on the ground.
In Arizona a lot of the houses are flat-roofed, so putting them on the roof is convenient, and gets them out of sight (mostly) and out of mind. Also, on really hot days the only breeze to aid cooling of the unit is higher up rather than at ground level, so they work more efficiently there. Also, in many areas of the SW states, blowing grit in duststorms and sandstorms and normal winds gets into the mechanism - more so at ground level then up higher, so putting them on the roof reduces wear and tear on the equipment, especially in instances like during Haboobs where dust or sand may get thick enough to actually pile up against ground-mounted equipment thick enough to block mechanical equipment like fans, or to block cooling intakes and fins.