Employees often are vulnerable to anxiety or even guilt when a shadow is cast on their employer’s image, says
Annie McKee,
author of “How to Be Happy At Work.” Some wonder, “Why am I here, if this company is doing this thing that I believe is wrong?”

There are ways to keep your morale up while working for an employer under fire. It might require separating your own sense of identity from your employer’s image, or looking for new ways to find purpose or meaning on the job.

For some, the solution is to head for the exit. Recruiters often see “a flurry of activity when a company’s name hits the headlines,” as employees test their prospects in the job market, says
John Reed,
senior executive director of technology recruiting at the staffing firm Robert Half in Menlo Park, Calif.

Paulina Lopez
wanted to work for an employer she could feel proud of, and thought she’d found that at Uber Technologies Inc., Ms. Lopez says. She liked her manager and colleagues at the ride-hailing company, and was treated well.

Extended family members raised questions after seeing reports of alleged sexism and sexual harassment in Uber’s executive ranks. “My family was asking, ‘You’re not like that. Why do you want to stay at a place where something like that could happen?’ ” Ms. Lopez says.

She considers herself a feminist, and “staying there would have meant going against what I believe in”—not because she’d been treated badly, but because she believed her colleagues had been wronged in ways that might affect her in the future, she says. She parted on good terms with colleagues and moved on to a new job.

It’s harder these days for employees to separate their personal identity from their job. “Nothing is hidden anymore” because details of corporate and personal life can be shared widely on social media, says
Mary C. Gentile.
She is the author of “Giving Voice to Values,” a book on acting on your values, and founder of a program by the same name based at the University of Virginia Darden School of Business.

Attacks on a company’s ethics cut especially deep for younger employees, who place a higher value on finding purpose and meaning in their work, according to a 2017 survey of nearly 8,000 millennial workers by Deloitte LLP.

Many employees stay on the job anyway because they need the paycheck or don’t see better opportunities elsewhere.

Others find satisfaction in focusing on personal career goals. Gabby Toro-Rosa took a job at a unit of Uber last year to gain sales experience while waiting for an opening at a public-relations agency where she wanted to work. While the negative publicity made selling Uber’s services a little harder, “I didn’t get worked up about it, because I knew I was doing my job,” she says. Her manager treated her well, and she recently moved on to the job she wanted.

Dr. McKee advises figuring out what parts of your work you can control and asking yourself: Is there a way for me to live my values and have a positive impact at the company? One manager she coached was frustrated by his employer’s toxic, disrespectful culture. He resolved to manage his own team differently, and set up processes to treat employees well and reward them for successes, says Dr. McKee, a senior fellow at the University of Pennsylvania.

Some employees pitch a new role that doesn’t yet exist, says
Christine Bader,
author of “The Evolution of a Corporate Idealist,” a book about how to advocate inside companies for social or environmental causes. “If you feel there’s some potential to do good work, then take some time to explore whether you can do that,” says Ms. Bader, a Seattle-based former human-rights policy manager at
BP
PLC, the oil company. She recently finished a two-year stint at Amazon setting up programs aimed at ensuring fair working conditions among its private-label suppliers.

“There’s a shadowy side,” however, Ms. Bader says. “If you take that thinking too far, to the point that you’re rationalizing staying at a place where you truly shouldn’t be, then that’s no good.”

Nora Hamada
hoped to provide job seekers and employers personalized placement services when she co-founded a recruiting firm years ago. She wanted to invest more time in placing candidates than other recruiting firms did, and to pay more attention to individuals’ needs and goals.

She was disappointed when her partners didn’t appear to share her values. “I wasn’t proud of the work we were doing together. The sense of purpose was no longer there,” says Ms. Hamada, of New York. An employee quit after experiencing what Ms. Hamada considered verbal abuse. “It was a nightmare. I was actually getting sick from all the stress. I had to leave the job for my own sanity,” Ms. Hamada says.

After two years, she quit and founded her own tech-industry recruiting company, Mirus Search.