Isn't the stated intent of most censorship to protect from harm?
But if it needs to be clearer: in censorship the harm is in the ideas themselves, the perspectives they spread.
In prohibitions that are non-censorship, it doesn't have anything to do with ideas. You aren't locking your door to prevent the idea of burglars entering your house.