It's illegal in Colorado for a business to refuse service to someone because of their sexual orientation. That's the law under which the state tried to penalize the baker.
Alex Jones violated Twitter's ToS by, among other things, encouraging armed violence.
There's zero tension in thinking that both Twitter and the state of Colorado acted defensibly in these two cases.