I've seen square and round, or having an "eye" shaped cross section. They might be square simply because of the need for mounting screws on the face on most motors. Having extra material might help a little in strength, especially if a plastic is used as the motor housing.
Many, but not all, brushless servo motors are square in the profile of their casings. The extra metal in the corners of the square of the stator casing helps dissipate the heat generated in the stator windings, basically acting as fins of a heat sink.
You never see this on brushed servo motors, because the windings are on the rotor, so there is no good conduction path out.