This is real damn simple. These companies want to make money, and they have made the clear-eyed, financially-motivated calculation that the majority in the U.S. and Canada are tired of racist, homophobic, sexist cowards, and are willing to put their money where their ideas are.
Therefore, just as these companies once shunned non-whites and patronized women, knowing that the money was in the hands of white, male customers, they have now made the commercial calculation that it is more in their financial interest to cater to all, because the seething cowards who will shun them don't have enough money to make it worth pissing off the larger sector of society.
It's Adam Smith's own capitalism in its purest form, enforce by hard-eyed money people who don't give a damn about any colour but green (and in Canada, blue, red, and purple).