He is intentionally putting the toilet door controller into a state where a vacant toilet can no longer be accessed. That toilet is of no use to people needing the toilet ... he broke the toilet.
It was back to functioning normally only a short time later in any case.
In any case, on behalf of British train users, please stop occupying the toilet needlessly and playing with the door locks. What happens if you or the next person gets locked in there? What happens if someone thinks you're being suspicious and calls the transport police? The services are delayed enough as it is.