But Paul said to him, “God will slap you, you corrupt hypocrite! What kind of judge are you to break the law yourself by ordering me struck like that?”
The judge ordered Paul to be slapped which was against the law.
Paul points out to him the hypocrisy of this order.
To stand in authority meant for good and to use that authority as an instrument of evil is an abomination and Paul rightly points out the misuse of this judge's position.
All authority comes from God and those in places of authority bear the responsibility of using that authority for good, not for private gain or protection of their power.