The practice started based on Flange Mount Disconnect handle operators, because the mounting holes for them were always on the upper right of the enclosure. This was originally a specification from Ford Motor Co., who developed a lot of the things we now call standards, when they modernized the assembly line process in the 1920s and 30s. No idea why it was top right, but likely it was just because the guy who thought of it was right handed.
Related back story: Henry Ford (Sr.) was an avid hunter, and one of his best friends and hunting partners was Charles Horn, the owner of Federal Arms and Cartridge Co. near Minneapolis. During WWII, Federal got a huge contract for supplying gun ammo to the US military, during which they developed the metal version of what we now know as the ubiquitous "Ammo Can", that long rectangular box with a clamp down lid and a rubber gasket for holding machine gun ammo. Prior to that they had been wooden with metal parts, Federal made them all metal to make them more durable, and because parts of WWII were being fought in more humid climates where the wood might rot.
When hunting with Horn after the war, Ford noticed that Horn carried and stored a lot of other supplies in ammo cans, and he marveled at how well they protected the contents from the elements. One of Ford's engineers, named Hoffman, came to him with an ongoing problem of the cast iron boxes used at the time for housing electrical controls on the assembly lines. They were not sealing well and machine oil in the air was causing problems with the controls. So Ford told him about the ammo cans and sent Hoffman to Minnesota to work with Federal to develop electrical enclosures based on that design that would stand up to the environment of an auto assembly line. That's how Hoffman Enclosures started and for years afterward, they were still located inside of the Federal Arms production facility. When I went to visit in the late 70's (and heard this story), we had to have DOD clearance to go on site. For years afterward, whenever an electrical enclosure issue came up at a Ford plant, it was solved at the Hoffman plant. Ford wrote a lot of the early standards that later became the JIC (Joint Industry Council) that later morphed into NFPA 79 standards that we use today. It was in those standards that the idea started about having the disconnect mechanism located on a flange of the enclosure. It was so that when the door was opened, the handle was still connected to the breaker (a requirement that still exists today as "NFPA 79 handles"). The concept of a through-door rotary operating mechanism was not considered "industrial duty" for a long time. The original "NEMA 12" specifications were "Dust tight, oil tight, industrial duty", with the last part meaning designed for industrial safety. Originally, a NEMA 12 electrical enclosure was REQUIRED to have TWO locking mechanisms. That's why you would see the interlock with the handle, and ANOTHER latch mechanism down below, which required a "tool" to be opened. That tool requirement was to keep operators out of the boxes so that they couldn't sabotage a production machine and get to go home with pay. All of that changed and was relaxed, to where Type 12 now just means the sealing issues.