It's pretty hard to justify how banning Trump benefits shareholders. Without a doubt, his precense drives user engagement and therefore ad revenue. There's no credible threat of boycott. It's pretty clear executives made this decision in the interest of democracy rather than maximizing shareholder returns. Facebook has never disclosed this consideration on its SEC filings. Therefore under American corporate law, that opens up management to liability.
I'm not taking a stance whether this is good or bad. But I do think that politically motivated security fraud lawsuits against Twitter and Facebook are eventually inevitable. Not least because political opponents will heavily subsidize the plaintiffs, even if the case doesn't look likely to win.