Yeah, I'd say the military is brainwashed enough to just fall in line.
I used to think our armed forces had enough integrity and dignity to not follow illegal orders, but I've been proven wrong.
It's not that they're brainwashed, but the USMCJ (US military code of justice) is rather problematic in its procedures/ruling around illegal orders. Soldiers are also generally trained to assume that any order they are given is lawful and must be followed.
In most other NATO/Western countries, it's codified into military law that any enlisted personal, non-commissioned officer or commissioned office can ignore/not follow clearly illegal orders with few/little repercussions. (eg things listed in the Geneva Conventions, or known state/federal laws that are deemed to common knowledge). They even have the right to question orders at the time without repercussion. (This is for orders that most people would consider illegal, eg shot unarmed civilians who are protesting). For more nuance orders, well, document and cover your arse. (eg formal notice that you believe the order is unlawful, but following the order in protest, as the lawfulness of the order cannot be determined at the time). Good commanders and leaders will side with their sub-ordinates in these matters and push it uphill.
The US, not so much. Whilst personal are required to ignore/not follow illegal orders, they themselves have no/little legal authority to define what is a legal/lawful or illegal/unlawful order. That is left up to a convened Court-Martial. Basically a solder, themselves on dis-obeying an illegal order are themselves placed under arrest (under the charge of disobeying a lawful order), and then their sole defence is proof that the order itself was illegal. While the court-martial is convened they are stripped of all privileges, and are generally incarcerated. The court-martial is permanently on record, and the solder will often be seen as not a team player, and so on.
For some matters, proving an order was illegal is trivial to do (eg breaking the convention of rules of warfare), but in most cases it can be very-very hard to do. When a soldier is deployed they are often given a general "rules of engagement" (ROE) that is essentially the do/do-not list of things they can/cannot do. The soldiers must follow the ROE even if they may result in unlawful actions. (basically a solder needs to follow the USMCJ, federal laws, state laws, deployment rules and ROE).
Now on the deployment of Marines in LA. I would assume that their mission is to secure/protect federal buildings (a lawful deployment of a federal military unit), and would have an ROE based on that mission. If a civilian attempts to enter said building without lawful intent, then the solders on the ground can perform any actions as deemed appropriate in the ROE. For example, shooting a civilian is unlawful except in self-defence, but the ROE may require/allow some use of force to prevent entry, eg shooting a civilian now becomes lawful under the ROE, or for example a solder in there general duties is not allowed to detain/arrest a civilian (they are not law enforcement), but can detain a civilian in accordance with the ROE if the ROE deems it necessary, and the arrest part comes into effect when Law Enforcement (eg the police) are onsite. A Marine in this instance cannot go out beyond the provided ROE and start detaining "illegals", as this is a breach of federal law, USMCJ and the ROE/deployment rules given.
Basically there is a lot of nuance in the USMCJ handles unlawful orders, and it's not in favour of the people receiving said orders. There are many examples (especially from the early GWOT era) where solders have attempted to not follow orders, as their personal belief they were unlawful, only to front a court-martial to find out otherwise. This may have lead to fear about not following any orders, even clearly unlawful ones.
Now at the top of the food chain, eg the Generals getting the orders, this is where the real push back should be coming from, and unfortunately in the US (from an out-side observer) the higher you go, the more political the appointment, not to mention the "boys-club" effect. There should absolutely be an entire legal team inside the pentagon and at the top of each branch giving over every and all orders given from the executive branch to determine if they are legal, and what ROE should be applied to those orders to ensure they are lawful.