But the two he refused to serve were homosexuals. He refused to provide a service to them that he would have provided to a heterosexual couple. That's what violated the state law.
What is your point? Serving Customers is one thing, violating your Religious Beliefs (which have Constitutional Protections in this Country) in doing so are another.
He would have gladly sold them a Cake, but he refused to Decorate it to sanctify something he feels is adverse to his Religious Beliefs.
Are you sure you are Posting on the right Website? This issue has been discussed thousands of times here.