AR 600-20 para 4-3 is specific:
The actions of military personnel will reflect respect to both the national anthem and the national colors. The courtesies listed in AR 600–25, appendix A, should be rendered the national colors and national anthem at public events whether the Soldier is off or on duty, whether he or she is in or out of uniform. Intentional disrespect to the national colors or national anthem is conduct prejudicial to good order and discipline and discredits the military service.
Please understand that corrective training is not punishment. It is training specifically designed to correct a perceived deficit. Your commander clearly believes your lack of courtesy is a training failure. If he wants to conduct corrective training to eliminate the deficiency, it is well within his authority. See Using corrective training to motivate substandard performers to learn more about corrective training.
On a personal note: If you have chosen to serve our country, you have also chosen to respect the symbols of our nation.