Thank you for your question.
The military culture, in and of itself, allows people to do extraordinary things as a group and as a team. The values that make a team capable of dealing with very hostile environments are good, and fundamental to that team's success. Values like obedience, loyalty, and fighting spirit are all things that are very important to having cohesive teams.
However, if this is not framed by discipline, toxicity can easily set in within teams. Very quickly, bullying can be confused with leadership, arrogance with confidence, lying with loyalty, and so on. If there is no strict discipline in this regard, toxicity sets in and all this creates power dynamics within the hierarchy. That's what makes things like sexual misconduct and other unprofessional behaviour happen as well.
I could go on and on, but I think I have answered your question. At least, I hope so.