How does the Supreme Court balance the right to seek legal remedy with the need for accountability in sensitive cases?

The Supreme Court recently asked Seeman to apologise to a woman or face dismissal of his petition to quash criminal proceedings. I want to understand how courts ensure justice for both the accused and complainant, especially in cases involving public figures.