Actually, if our military unilaterally exercised a 'right to repair' for commercially available items, soon enough they would find that no manufacturer that relied on service revenue would offer them to the military, and if they did, likely for substantially higher costs, to 'recover' that lost service revenue.
Beyond the simple 'we bought it, we own it, we need to fix it', there is the somewhat simpler imperative - in war, you succeed or fail. Failure is costly. Unable to feed your crew, do you withdraw? And what are the consequences of that withdrawal? Failure is not an option, and that is not a platitude.
It's a failure of our military that they permit such things to occur at all. Not perhaps the Navy, but other branches, and for the Navy perhaps onshore, too much has been delegated to civilian contractors. Food service is one obvious example. And a common explanation I have heard is that enlistment is so challenged that there are not enough personnel to do 'all that'. Oh, downstream of failed leadership, I think. Leadership is crucial.
If you've paid attention, you know that McDonalds has had trouble keeping ice cream machines running, being hostage to the manufacture and software. For a frikin ice cream machine. Stupid.
And if you're aware of that, you might also be aware of John Deere masking every effort to prevent farmers form repairing their equipment, which during harvest can result in hours waiting for a technician, and lost crops. Lost money. Inexcusable. And again, software.
Right To Repair is going to be essential going on, the simplest things are becoming complex. Home automation suffers from vendor lock-in, and when the support revenue stream dries up, they capriciously 'end of life' items, and that's that, you're abandoned. No promise prevents this.
Our military needs to require this and enforce such contracts. To do otherwise is to risk their troops' lives, and ours.