It would help to have link to the ad you mention:
https://www.apple.com/ipad-air-2/change/
Not all the lyrics you posted are in the ad, unless you’ve seen a longer version.
They edited out the reference to both burning the flag and the dis of the military in the commercial. But this is the song they’re promoting.
I’m sure the ad wouldn’t have been approved with those words in it. Shoot, the execs that approved the ad probably didn’t know the rest of the words.
But the ad writers surely knew what they were doing. Including this particular song is certainly designed to send the message of the song:
We’re cooler than thou rebels.
By using this song, Apple is incorporating the tone and meaning of the song in their ad. They can’t have it both ways:
Look how cool we are but we really didn’t mean that it was OK to burn the flag just because we alluded to our hipness with a song that advocates just that...