There is a law for that.
36 USC ยง175. Position and manner of display
- (e) The flag of the United States of America should be at the center and at the highest point of the group when a number of flags of States or localities or pennants of societies are grouped and displayed from staffs.
- (f) When flags of States, cities, or localities, or pennants of societies are flown on the same halyard with the flag of the United States, the latter should always be at the peak. When the flags are flown from adjacent staffs, the flag of the United States should be hoisted first and lowered last. No such flag or pennant may be placed above the flag of the United States or to the United States flag's right.