I don't care what their intentions are, if someone breaks into your home there's a need to kick their ass. If for no other reason then to teach them why they shouldn't be breaking into other's homes. Ditto if someone arranges to have someone else break into your home.Because she didn't feel there was a need to, yet?
And if you're the XO of a military ship, and someone breaks into your quarters or arranges to have someone else break into your quarters, there's a need to have them punished. Both to make sure they don't break into anyone else's quarters and to make sure others on the ship don't get the idea it's okay to break into your quarters.
To say nothing of the potential security ramifications. The XO's quarters are presumably locked when they aren't in them. If someone can hack the lock of the XO's quarters, they'd theoretically have access to any sensitive information concerning the ship and/or the Union kept within. To say nothing of the fact they likely have the skill necessary to break into anyone else's quarters, including the Captain's or any other secure location on the ship.