He was right to apologize for two reasons.
First, it was a Marine Corps "Toys for Tots" campaign, and politics was not appropriate to the occasion.
Second, he was tying the Marine Corps to his criticism of the Administration. The military in the US, unlike many other countries, goes out of its way to refrain from politics. That is a good thing.
That said, "Have a Happy New Year, Gunny."
I believe you’re right. Not at all the appropriate place for political remarks.