They had to know the Vichy Government were puppets of Nazi Germany. How could they go from a mindset of trying to resist (Scuttling of the Navy at Toulon) to so openly opposing the Allies during the early part of the war. Opposing the landings in Morocco during Operation Torch comes to mind. I've seen arguments like the "honor of the French Navy" was at stake. But shouldn't they be more opposed to being puppets of the enemy who invaded their country? Were some of the admirals just really power hungry?
I can't wrap my hide why so many of them just willingly went along with Vichy France in the face of defeat at the hands of the Germans. What caused this?
This is actually a wider field of discussion, and one with a lot of historical baggage. Collaboration with the Germans was and remains a touchy subject, but it's worth keeping in mind it wasn't just the French military, but also large segments of the French right (and just opportunists) worked with the Germans.
From this context though:
There were segments of the French military who did not really see themselves as the "allies" as much as they'd been abandoned by the British (who fled at Dunkirk in that narrative), and then proceeded to kill French sailors who refused to desert to the British (again, from a certain French perspective). In this context they had zero loyalty to the Allies (or their French "comrades" who were violating the "legal" orders from their chain of command) who were now showing up and shooting at them (or demanding they abandon their "duty" or at least meal tickets).
The French were nominally neutral, but also still had a government that was controlled by the Nazis at the end of the day. This isn't to be confused with the standard "THEY HAD NO CHOICE!" narrative that comes up with the Nazis and collaborators, but in a lot of ways, you have a French government giving orders on behalf of the Nazi government. You place people in a construct that issues orders with expected compliance, and even with "reluctant" troops, you will have some sort of following of orders. It's a simple pragmatic position to keep showing up to work, it's just one morning that work has you sitting on the receiving end of bullets.
It's still worth keeping in mind the French did put up less than total resistance, and many did ultimately surrender and switch sides once the Allies returned. This is a bit more of a complicated issue (again, who's the loyal Soldier of France that was awaiting the chance to arise and strike at the hated bouche, vs who was the guy who liked the idea of beating up commies but didn't like the idea of POW camps so uh, go Allies?), but the troops of Vichy France didn't exactly put up a fight to the last.
Finally there were parts of the French right that the Nazi narrative spoke too. Antisemitism in France wasn't exactly low key, and there were a lot of people who blamed the French left for basically leaving France unprotected from the Germans (by labor movements undermining French military production, resisting conscription, basically the French version of the "Stabbed in the Back" narrative). This reactionary element bought into the whole Nazi narrative in regards to the "threat" of communism, and the like. So in that there were certainly some actual pro-Nazi French military personnel who fought because they thought the Allies were the "bad guys" and needed to be stopped.