I got news for you. Happens all the time. Cops beat the poo out of someone if they know they have information that can save an innocent person's life.
Besides that being a pretty rotten comparison, what you're describing is also illegal.
Should we change the laws to let them both be legal?