When people think of a photo sharing app they are thinking of breezy fun social media times. When people think of rare disease treatments the sentiment is much darker a priori. I'm not saying drug companies are to blame for the current situation (hate the game not the player), but emotionally it's obvious why there is judgement about profiting from that situation.
Affordability is then about transferring money from rich people to poor people so they can buy the appropriately-priced drug.
A common problem with these arguments is the assumption that they take something from the rich. The reality is the cycle started earlier, and redistribution is a necessary correction to that, not an outrageous and immoral imposition on a presumed natural order.
In most of these cases, they've sold something for billions to a single entity that has the money and doesn't strictly need it (for example, if Youtube had not sold to Google it would have been an existential crisis for Youtube, not for Google).
When you save 10 lives and charge billions you are a criminal.
In these ten sales, you've made billions by charging each of the individuals 1/10th of the billions, individuals who don't have the money and do strictly need it.
There's a difference between "sells for billions" and "charges billions": in the former in the case of photo sharing apps, it's a buyer's market, and in the later it's a seller's market.
The founders, the sellers, might get praised in the event of a billion dollar photo sharing app sale, but few have sympathy for the purchasing party in that transaction, no matter what they paid, because it's a buyer's market.
I'm not sure fair, to the drug makers or otherwise, enters into it. These are not really that comparable, and only appear to be due to the scale of the sales both being "billions".