As a giant fan of Samus myself, I just had to put my two cents to a fellow fan
I too found it hard she served in the military, but I like to think she had no choice.
Here's why : when the Chozo suddenly left, they let no explanation for why, nor anymore tips of how to atteign to the Varia suit, and even less it's antigravity function.
Let's imagine Samus left with her power suit. It's basic and can barely function at the height it's expected. As a whiny kid growing up, she might just get angry and say to Old Bird (her mentor) to show her. But as a kind of Yoda, he would comment that she needs to control her anger, acquire discipline and concentrate. "Little steps, baby chicken".
And suddenly, Old Bird and (most of) the others dissapear.
"Great! Now how am I going to acquire the Varia threshold?!" she would mumble.
"No way am I going to let spooky MotherBrain nanny tell ME what to do."
Thus this led her to the military.
She then chooses to hide the fact that she has technology that can surpass the Federation's suits until that moment Ian Malkovich was in trouble. She implied she could help him (Chozo DNA augmented and all), but because Adam didn't know about the higher suit's functionnality, saying she lacks something (and she yet may had), he didn't give her the permission.
And that's why she left; Adam didn't have faith in her, and thus she could not see herself trusting her with the secret of her Chozo legacy... until probably hours before her leaving she managed to acquire the Varia's full power in front of him and close friends, then leave with an angry gaze, as if "Well, I don't need your sh*t anymore... So I guess I'll be on my way."
Last but not least, MotherBrain, one of the Chozo's greatest invention (along with Samus' suit and the Metroid), did suggest that they left of fear of a great danger, and calculated that it was the Federation itself that would become this danger, pining Samus against her own kin. This might pull into the equation further on.
Again, I might be implying and turning to false conclusion, but according to what I gathered so far, I like to think it went something like that.
Just my view here.