Shere khan was a evil lawful type of justice but only when he was protecting the jungle. It’s messed up to try to kill a kid but you have to understand in the movie, humans have been pillaging the jungle for awhile he knew that one day Mowgli will end up like one of them.