I can't believe there' s a pro guard anti guard convo here. Yes, his job was to stop unauthorized people from getting into the temple, but there are multiple ways to reach that goal: have someone remove her or just keep standing in her way. Instead, he played baseball with her face because she said a couple of crazy things. Even another guard thought he went overboard. Someone of his own profession thought he was wrong... How could people argue otherwise? Plus he intended to keep hitting her. He didn't hit her to keep her out. He did it cause he was mad that a maid was disrespectful to him. Also, if it had caused enough of a scene, it would have disrupted the ceremony which would ultimately negate his whole function.
It's like if a bouncer slapped someone hard across the face when someone who was denied said snarky remark.