Much as I hate to defend Trump, if you watch the video it's pretty clear that this was an attempt at humor, along the lines of when someone says that "if you catch a child molster, just toss him in a cell with a big black dude named bubba, and then turn the lights down low for them."
It's pretty typical of Trump humour when you listen, it's a bit rambly and loses a lot of it's bite because of the way he speaks, but from the tone of voice and the way it is delivered, it's is him trying to do a funny. It's also responded to in the same way, first with the laughter you give a Dad Joke, and then by, oh, the President told a joke, we better applaud it.
Was it a funny joke? Not in my opinion, and the way he delivers his jokes makes them rambling and tends to suck the funny out of them even when they could be funny, so not a big change there.
Was it appropriate, again not in my opinion. It's not the sort of joke that a President should be trying to tell in a speech, even if they are capable of getting humor across well. No more then if they told the Bubba joke above, there are certain things that might work fine down the pub with your mates, but you just don't say and do as President, and this was one.
Was it the President inciting violence and police cheering because they are inherently brutal and want to beat on people... again, not in my opinion.