You are right, it was a no-no.
Jonathan Turley
@JonathanTurley
The optics of Biden’s speech instantly became a source of Internet chatter with the weird red background that made the President look like he was giving a stump speech from Dante’s Inferno. However, it was the use of the Marine guards that were the most glaring element...
...Under Department of Defense Directive 1344.10 (”Political Activities for Members of the Armed Forces”) members of the Armed Forces may not engage in political activities...
...The long list of prohibited acts include: “Attend partisan political events as an official representative of the Armed Forces, except as a member of a joint Armed Forces color guard ...
...at the opening ceremonies of the national conventions of the Republican, Democratic, or other political parties recognized by the Federal Elections Committee or as otherwise authorized by the Secretary concerned.”
‘It’s Wrong’: CNN Blasts Biden for Using Military As Backdrop for ‘Battle’ Speech