(CNN)On Monday, Hayley Geftman-Gold, a top CBS executive, posted on Facebook that she didn't have sympathy for the victims gunned down at the country music festival in Las Vegas because "country music fans are often Republican gun toters."

She was immediately fired.

As a Democrat who favors strict gun control laws, I was outraged by Geftman-Gold's statement about the deadliest shooting in American history. It's unconscionable to not feel for the victims of such a heinous crime.

Kara S. Alaimo

That's why CBS was right to fire her. Geftman-Gold is one of a long line of individuals who have been axed for saying outrageous things on social media. Remember the InterActiveCorp PR executive who tweeted that she wouldn't get AIDS in Africa because she was white, or the Florida prosecutor who posted on Facebook after last year's shooting at the Pulse nightclub that all of Orlando's nightclubs should be shuttered because they're "cesspools of debauchery?"

These cases are warnings for us all to think before we tweet. "Every day, the words and images we all choose to share can do more than simply embarrass us -- they can affect our entire future," Sue Scheff and Melissa Schorr caution in their new book, "Shame Nation: The Global Epidemic of Online Hate."

Read More

These instances are also rare cases in which it's acceptable for companies to fire staffers for their social media posts. When employees write posts as private citizens, which may be damaging to their employer's reputation or which call into question the employees' abilities to perform their jobs, they should be fired.

Though much of this may be intuitive, companies should spell out for staffers what sorts of posts -- racist, sexist or otherwise -- are unacceptable and subject to disciplinary action. Nicholas Fortuna, founder and managing partner of the law firm Allyn & Fortuna LLP, says it is generally legal to fire staffers for such reasons. "Unless there is a written contract limiting the circumstances (in which) an employee can be fired, an employer may fire someone without cause, for any or no reason, as long as it's not an impermissible reason, such as discussing terms and conditions of employment, discrimination based on race, sex, national origin, in some states sexual orientation, etc.," he says.

JUST WATCHED

Florida prosecutor suspended after online Orlando rant

MUST WATCH

But prohibiting these kinds of outrageous posts are the only time employers should get involved in what their staffers share on their personal social media accounts.

Currently, many companies have policies that don't allow any staffers except public relations executives to talk about their organizations on social media. That's a bad idea. Employees clearly can't be allowed to post trade secrets, but broader bans on discussing work are generally a mistake -- and for three reasons.

First, when a company is under attack, employees are often quick to come to the defense of their employers on social media. A 2014 study by Weber Shandwick, one of the world's largest PR firms, found that almost 60% of employees have defended their employers, either to their friends and family or more publicly. But they can only do so if they're empowered to post.

Take this LinkedIn post, for example, written by an Amazon employee who defended the company of his own volition in response to a negative article in The New York Times, which claimed that Amazon is a hostile place to work.

Second, it's bad for a company's reputation to be seen as limiting their staffers' rights to free speech. One way to prevent negative discussions of a company on public platforms is to provide internal forums where employees can debate work issues -- something that Google has done for years. It doesn't always work, as we saw when a memo by a Google engineer questioning women's ability to handle tech jobs went public in August. (That staffer was fired, too). But it's a good way to move a lot of critical and possibly controversial discussions to private platforms.

Third, companies risk breaking the law by firing employees for certain social media posts -- particularly those about workplace conditions. "Under the National Labor Relations Act, employers can't restrict or prevent employees from speaking out about their terms and conditions of employment," says Fortuna. "That is true even if the employees speak out in an offensive manner."

So, Geftman-Gold's posting offers lessons for us all: think carefully before you fire off a tweet -- and also before you fire a staffer for doing so.