I always thought the opposite, that they weren’t allowed to as that was a job more appropriate for a Sargent. That not only it was against articles of war but it was conduct unbecoming. Not for moral reasons, obviously, but as a holdover from the lords/upper classes being officers and it being beneath them.
It’s referenced in Sharpe’s rifles based during the Napoleonic wars. Sharpe an officer made up from the ranks is looked down on by the other officers who are all mostly lords/wealthy with the odd prince thrown in. He gets into a fight with a regular rifleman who’s hungover and mistakes him for a typical soft officer. He’s then chastised by another pair of officers for brawling with the “common soldiery” or something to that effect. Seems like a good idea to prevent lords newly minted as officers making the mistake and getting mauled by actual soldiers.