WASHINGTON—President Trump delivered his elaborate Fourth of July celebration, defying critics and honoring the military.

Rain fell throughout a hot, muggy afternoon in the nation’s capital, but thousands showed up to hear the evening address, part of Mr. Trump’s “Salute to America” that featured flyovers of booming jet fighters, military...