Let's maybe spell out separately whether or not these two situations are equivalent or not a) legally, b) ethically, c) in principle.
a) As I stated in the argument about the difference between discrimination against protected classes versus hosting content on a private server, I'd say that legally, these are not equivalent.
b) Ethically is an interesting question. Since the ethics of denying someone service based on their sexual orientation is largely viewed as reprehensible, maybe a better question would be whether or not (freed from questions of protected class) the baker would decorate a Nazi themed cake versus allowing federated apps that are largely used for the dissemination of white supremacist ideology to be hosted?
c) In principle, I'd say they are not equivalent for the following reason: selling and decorating a cake is a business transaction between two entities. The cake (decorated or not) ownership moves from producer to consumer. The consumer is purchasing a physical cake. If the cake is ever made public, it is at the behest of the purchasers of the cake, and any consequences of that public display will be suffered by the purchaser. Essentially, the baker's name is not on the cake, and no one needs to know.
Hosting apps or other contents affects the reputation of the hosting company, and damages to their business reputation fall on it. Think about Facebook being recognized as a conduit for foreign interference in U.S. elections, or whether or not the New York Times will accept ad content from an adult video company. The name on the masthead is the entity that suffers the damage first.
The difference is in the legal definition of protected class. It is illegal to discriminate against someone based on their membership of a protected class -- ethnicity or disability for instance.
Removing an opinion or banning a user based on violation of an agreed upon term of service is not the same thing. Having an opinion does not make you a member of a protected class, and a private corporation is free to allow you or disallow you from use of their services to broadcast that opinion. Newspapers have been doing this since the dawn of print. Google could not, for example, ban someone for being Jewish.
You can argue about whether sexual orientation deserves status as a protected class, but it is disingenuous to claim that the two are the same thing under the law. It is a false equivalency.