"But the code was first drawn up only in 1923 under the auspices of the American Legion, and only became law when the US was at war, in 1942."
"The Flag Code covers all aspects of etiquette in relation to the Stars and Stripes, including how to behave when the anthem is played. The code is never enforced, however, and there is no punishment for breaching it."
http://www.bbc.co.uk/news/world-us-canada-37208404
I think Kaepernick and Gabby Douglas may disagree on the "no punishment" bit.
http://www.independent.co.uk/news/people/rio-2016-gabby-douglas-national-anthem-twitter-gymnastics-hand-on-heart-criticism-a7182451.html
e: Even the POTUS is not immune and that's why it's incredible that an irrelevance like a washed up back-up quarterback can create such a ripple in as massive a country as the USA!
"President Barack Obama famously neglected to put his hand over his heart during the 2008 election campaign. He explained his mistake by saying his grandfather taught him to do this only during the pledge, and to only sing during the anthem."