It's called cocktail/upright modes.
This could probably be attributed to a bug in mame, but I doubt anyone cares enough to mess with it.
Is this an answer for the OP Q? If so, it's not a real bug. The original game could have one or two sets of inputs, depending on a dipswitch set to upright or cocktail, respectively (or whatever names the original game used). And since the game used player 2 inputs sometimes, the driver has to include them. Mame does not have a way to disable player 2's inputs if there is a cocktail dipswitch that's set to upright, and it doesn't need to for the game to run correctly. In fact, the current way mame more correctly emulates the original hardware (IOW, the original game had places to wire up player 2 controls, but if the dipswitch was set to upright, it would act just like mame does).
Now, there are a few games that do not correctly emulate screen flipping for cocktail mode, but otherwise like above. These games will switch player controls but not flip the screen like you want. You could edit the source and "break" the screen flip in the games you want, but it's not an easy hack AFAIK.
The dipswitches could be "hardware" or "software" dipswitches. If it was hardware dipswitch, the original board had a physical dipswitch, and you can get to them in mame by pressing tab and selecting "Dip Switches". If the original game had dipswitches you could change from the screen, aka software dipswitches, you usually can get to it by pressing F2 (some games are different), and not all games have software dips. 1942 has a hardware dipswitch for cocktail/upright, that defaults to upright.