There are a few factors with Samantha Bee:
1. Considering her bit was in the context of political comedy TV show, it was likely written and greenlit, and therefore not unexpected by the production staff.
2. Samantha Bee is under control. She is predictable. She has no history of unpredictability.
3. The only people she offended are people who don't like bad words. Plus, given it was Ivanka Trump, it's not offending anyone her company or advertisement partners are targetting.
With Roseanne,
1. No doubt they lost a lot of money on it, Roseanne was their most popular show; but the loss didn't occur from cancelling the show, it's because Roseanne took a massive shit in the gravy, destroying its value.
2. Roseanne's actions (and potential future actions) offended a HUGE target market. One that ABC is heavily competing for. In fact, they only fall under Fox for the "African American" demographic.
3. If you pay attention to the commercials, they are targeting the "African American" audience as well, these brands have a relationship of trust with their consumer base.
4. My speculation: ABC was aware of Roseanne's history, but were willing to look past it for the potentially huge audience she would bring in. The chances are near certain the contract to green light the show was for her to stay away from Social Media and not embarrass their brand. To add evidence this occurred: people close to her, including her children attempted to keep her from social media for the duration of the show.
Doing a bit of research: ABC charges anywhere from $120,000 to $460,000 per minute of ad space across all their programming (minus events, that can go as high as 5 million a minute). A large portion of this advertisement is directed at the African American audience; because it is one of the most valuable consumer bases in the US. To explain this further:
1. Target audiences are generally created of people who are in similar situations. Most are temporary, like students, or parents of young children. Others are created through joint hardships.
2. When it comes to racial minorities, such as black people in the US, there was a long history of persecution and a shared experience of being the target of dehumanization (as Shrin points out). This shared experience of persecution created the African American class.
3. No doubt ABC has invested a lot of time and money into building up that relationship with African Americans. It's a large and incredibly valuable target consumer base because - unlike a father of a young child or a student - it's a potential lifelong relationship; e.g. if black people see Coca-Cola as their drink, that Coke will always be supportive of them, then a large number of African Americans are going to be compelled to purchase a coke when they want a soft drink.
4. Advertisement is not just money, but repetition over time. The psychology of repeating something over and over again and then people start becoming comfortable with it. Sometimes over weeks, other times over months and years; and then maintaining that after.
If ABC maintains a large number of African American viewers, they are valuable to advertisers competing for that target market. They increase their value as a network.
To put that into market terms, a large lifelong target consumer base, because African Americans are a HUGE population with a lot of spending power - a company establishing a relationship of trust can establish a lifelong bond, 60+ years of a large loyal customer base; this is why so many commercials feature black people - it's basically good business.
So going back to that $120,000 to $450,000 per minute - or up to several million per episode aired on their network.
While ABC lost money on Roseanne for cancelling the show, the potential for losing their hard-earned investment of the African American audience, and the potential of lost business partners who don't want to associate their brand as supporting a network who features someone deemed as anti-African American. Lets say they (hypothetically) lost $100-300 million; it's a loss, but it nothing compared to the potential loss of sponsorship partners across the board of their (I imagine) 24 hour programming schedule. She undermined their investment, and given her instability and unpredictability, her chance of embarrassing them again and insulting their consumers is high - ABC does not want to risk losing a very important consumer base they might never regain.
The last factor, most Americans - regardless of race - consider racism to be something that ranges from offensive to dangerous.
You can't say "Roseanne shouldn't have been fired" without considering the position of those people who stand to lose a lot of business by holding onto her. It's possible that if Roseanne DIDN'T have a history of that she would be given the benefit of the doubt; that they could reasonably convince their advertisement partners and audience that "this was an abnormal outburst." But given her history, that's impossible.
Shrin - I DO very much value you putting time into this board, as well as anyone else who does. We are one of the very oldest tight-knit communities on the Internet. We date back to 1997. Can anyone even find a community like ours that goes back that far?