"It is a brave man who volunteers to join the military knowing he could be killed in battle. He was a very brave man because he knew what the was getting into."
Seems likely that is probably the message that was supposed to be conveyed.
Yes, Trump's wording was wrong. So was his Audience. Probably not the appropriate thing to say to the widow.
Here's the appropriate thing to say, "I'm sorry for your loss. He did our country honor. Please contact my office if you or your family need anything."
Done!
Oh, yeah, and don't wait 12 days to do it.
And when someone is offended by the ham-fisted way you said it, don't go around calling them liars, criticizing how your predecessors handled similar situation, or doing anything else to deflect from your screw up.
But if Trump hadn't learned these life skills in the last 70 years, he's not going to learn them now.