I don;t think they should have come out and terminate him, but they have every right to do so. It's their dress code, it's their policy, and it's perfectly legal in my opinion. When you work for a company, your actions and appearance represent the entire company. If Home Depot doesn't want to look like they're promoting religious beliefs or displaying them, then they can make their dress code say so.
They have just as much right to not let him wear that button as he has a right to display his religious beliefs in public. But as long as he works for them, then he's got to follow their rules. If he doesn't like the rules, then he needs to find another fucking job.
Also, I'm not saying any of this based on my religious beliefs, I'm saying this as a guy who is a business major.