In December 2013 a PR woman called Justine Sacco tweeted to her 170 Twitter followers: “Going to Africa. Hope I don’t get Aids. Just kidding. I’m white!” The joke was intended to mock her own bubble of privilege, but while she slept on the plane Twitter took control of her life and dismantled it. She became the worldwide number one trending topic that night: “We are about to watch this Justine Sacco bitch get fired, in real time, before she even knows she’s being fired”, and “Everyone go report this cunt @justinesacco”, and so on, for a total of 100,000 tweets. Justine was fired, her reputation mangled. I recounted her story in my book, So You’ve Been Publicly Shamed. The chapter was excerpted in the New York Times Magazine. I’ve been keeping a diary of what happened next.

Condemnation began hesitantly at first, a little uncertain, like a consensus waiting to form: “The article did nothing but bring her back into the spotlight when we’d all moved on,” somebody tweeted. “Her dad is a billionaire,” someone replied. “I’m not too worried about her.” (Her father isn’t a billionaire. He sells carpets.) “That tweet didn’t ruin her life,” someone added. “Justine Sacco has a new job. Give me a break already.”

“After a year,” I thought when I read that one. “She got a new job after a year.” Nice people like us had effectively sentenced Justine Sacco to a year’s punishment for the crime of some poor phraseology in a tweet – as if some clunky wording had been a clue to her secret inner evil. The fact that she had managed to doggedly pull things back together after a year was now being used as evidence that the shaming had been no big deal from the start.

I remembered a time I was on a beach in Scotland and a flock of terns singled me out. They circled above me for a while, and then began to dive bomb, pecking at my head. This early, tentative disapproval felt like the terns circling. And then the dive-bombing began: “After reading that excerpt from his book. I think it’s safe to say @jonronson is a fucking racist.”

A group of Chelsea fans were filmed on the Paris Metro pushing a black man off the train and chanting: “We’re racist, we’re racist, and that’s the way we like it.” It was a shocking, awful video.

“Maybe Jon Ronson will cape up for ’em,” somebody wrote.

An opinion was beginning to form, and feed off itself, that I had written an attack on social justice, a defence of white privilege. In coming out against online shaming I was silencing marginalised voices – because online shaming is the only recourse of the marginalised, whereas the world automatically allows people like Justine to succeed. But I just couldn’t see how Justine’s shaming made anything better, given that her joke was intended to mock racism. What happened to Justine struck me as just another terrible thing happening in the world.

I decided to try to encourage those people to read the book, and so I tweeted: “By the way, the Justine Sacco story in the New York Times isn’t a stand-alone article. It’s an extract from a book.”

“Oh, now Ronson’s saying it’s an extract from a book,” someone wrote.

What did that mean? It was always an extract from a book. Did he think I ran home and quickly wrote a book? But anything I said in that moment, I realised, would just be more evidence for the prosecution, and so I went back to being silent.

“Why isn’t Jon Ronson replying to any of us?” someone tweeted.

“Because Jon Ronson only replies to men,” someone replied.

Twitter suddenly felt uncaring, intimidating, even dangerous ... Ronson. Photograph: Christopher Lane for the Guardian

I liked it when people went for me in ridiculous ways, because when I recounted those comments to other people they made me look good.

Still, I didn’t regret writing Justine’s story. I was basically being told, “It’s fine to write about those wronged people, but don’t write about that wronged person because it makes us look bad.” But a wronged person is a wronged person, even when they are an unfashionable wronged person.

I wrote about Justine not because I identified with her, although I did, but because I identified with the people who tore her apart. I consider myself a social justice person. It was my people, abusing our power.

I emailed Justine: “I’m getting an idea of what it was like to be you.”

“I’m really sorry if you’re getting death threats,” she emailed back. “No one should receive threats or words of violence at all.”

“Well nobody’s threatening to actually kill me,” I replied. (As is often the case with shamings, the range of insults levelled against Justine, a woman, had been far broader than those levelled against me, a man.)

A train crashed in Philadelphia. Passenger cars were ripped apart. Eight people died and 200 more were hospitalised. A survivor emerged from the wreckage and tweeted: “Thanks a lot for derailing my train. Can I please get my violin back from the 2nd car of the train?”

In the early days, Twitter was a place of curiosity and empathy. Back then, people might have responded to this woman: “Are you OK?” or “What was it like?” But that’s not how Twitter and Facebook responded in 2015. Instead, it was: “Some spoiled asshole is whining about her violin being on that Amtrak that derailed. People died on that train” and |“I hope the violin is crushed” and “I hope someone picks it up and smacks it against the train” and “Fuck that little bitch and her god-damned violin. I would slap the fuckin’ taste out of her mouth if she was in reach” and then – after she deleted her Twitter account – “Too bad she’s a coward and deleted her account, how will her violin ever be returned?” and “I hope you get your violin back from under the bleeding people. Good luck!” and “I hope it is destroyed” and “Your violin can be replaced. The DEAD are gone forever” and “Self-absorbed cunt” and “I won’t be cutting her any slack. What a sickening skank. I hope her life is exactly what a nasty bitch deserves” and “8 passengers dead, but she lives. No justice in the world”.

Like Justine, she was being shamed because she was perceived to have misused her privilege. And of course the misuse of privilege is a much better thing to get people for than the things we used to get people for, like having children out of wedlock. But a great number of people who hadn’t just been in a train crash were now accusing a woman who had just been in a train crash of being privileged. The phrase “misuse of privilege” was becoming a free pass to tear apart pretty much anybody we chose to. It was becoming a devalued term, and was making us lose our capacity for empathy and for distinguishing between serious and unserious transgressions.

I visited a TV studio in New York to film a video about the book. There was a doctor on before me, filming her own video.

“What’s your book about?” she asked me.

“Online shaming,” I replied.

“Oh, did you read that piece in the New York Times?” she asked.

“I wrote it,” I replied.

“Oh you must be so happy!” she said.

“Actually I’m not,” I replied.

“Why not?” she asked.

“Because there’s a backlash, with people calling me a racist,” I said.

“So what do you want?” she said.

I paused.

“Xanax?” I said.

She got out her pad and wrote me a prescription for 60 Xanax. After that I was no longer anxious. But I felt groggy. I had to weigh up whether to feel groggy or anxious. Later, I mentioned this to the comedian Joe Rogan. “Welcome to America,” he replied. “That’s our dilemma. Groggy or anxious.”

Rachel Dolezal who was relentlessly hounded online after being ‘outed’ as a white woman. Photograph: Annie Kuster for the Guardian

I was getting misdefined by some people as a racist, and as a consequence I was starting to misdefine myself as someone who felt the need to leap into pretty much any ambiguous shaming and take a counterintuitive position. It was becoming unseemly. On 12 June I read in the Guardian about Rachel Dolezal, the Washington State civil rights activist who had faked being black.

“What an extraordinary story,” I thought. “So mysterious and complicated. What led her to fake being black? Maybe she has a mental illness. Or maybe she doesn’t. Maybe she feels about colour the way some transgender people feel about gender. Or maybe she doesn’t feel that way.” I had a thousand questions. A journalist’s favourite question is “Why?” Why? opens doors into new worlds.

“I wonder what Twitter is making of it?” I thought. And so I went on Twitter.

“#RachelDolezal you can APPRECIATE a culture, without APPROPRIATING it. The fact you can’t grasp that is one reason you’re a racist idiot” and “#RachelDolezal has been living in ‘Black-Face’ her whole life, seems cut & dry racist to me” and “We should apply a super-strength relaxer onto #RachelDolezal head & not wash it out. Allow it to burn through her skull & racist brain” and “Make no mistake: #RachelDolezal is a self absorbed, psychotic & sociopathic racist.”

On social media we’d had the chance to do everything better, but instead of curiosity we were constantly lurching towards instant cold judgment. Maybe Dolezal was everything Twitter assumed she was, but what was wrong with a bit of waiting for evidence? Maybe she was reading all the tweets and thinking about killing herself. (That was possible. Three weeks earlier an Israeli government clerk called Ariel Runis had killed himself in similar circumstances.)

I was tired of us forever making damaged people our playthings. And so I tweeted: “Feeling incredibly sorry for #RachelDolezal and hope she’s okay. The world knows very little about her, her motives.”

I went to dinner. I chatted away with people at the table. Everyone was nice. I went on Twitter. Someone was calling me a white supremacist. I went back to the dinner conversation. It was nice. I went back on Twitter. Somebody, pretending to be me, had written: “Dylann Roof is good.” Dylann Roof was the racist who murdered nine African Americans in Charleston, South Carolina.

Someone told me I had no right to weigh into Dolezal’s story because, being white, it wasn’t my story. He added that, unlike her, he had no choice in being black or white. As a black man he was racially profiled every time he walked down the street. He was genuinely angry with me for chipping in the way I had. I explained my reasons – that after 30 years of writing about complicated, spiralling people I had opinions on how to consider them. But he was right. In all the hardening of positions I’d become a caricature.

I complained to Twitter about the man who, pretending to be me, commended the Charleston racist murderer. Twitter responded: “We have determined that it’s not in violation of Twitter’s impersonation policy.” I felt a flash of rage. Every time an online shaming occurred Twitter and Google made money. Whereas those of us doing the actual shaming? We got nothing. Twitter suddenly felt uncaring, intimidating, even dangerous. We were unpaid shaming interns for a company that didn’t care about us. I quit Twitter.

The world outside Twitter was great. I read books. I reconnected with people I knew from real life and met them for drinks in person. Then I drifted back on to Twitter.

Someone told me I would have avoided much of the criticism had I ended my book with a set of rules outlining when shamings were and weren’t OK. It hadn’t crossed my mind to do that because it sounded like the kind of thing lifestyle coaches do. And, anyway, it seemed obvious. During 2014 and 2015 videos were surfacing of police brutality against people of colour. People were dying: Eric Garner and Michael Brown and Sandra Bland. In McKinney, Texas a police officer was filmed pulling his gun on a group of unarmed black teenagers at a pool party. He violently wrestled a girl to the ground, using his bodyweight to pin her down. She was wearing a bikini. “I want to call my mom,” she screamed, terrified.

It didn’t need saying – but maybe it did – that using social media to distribute those videos was a world away from the Justine Sacco witchhunt. One was powerful and important, a new civil rights battlefield. The other was a nasty imitation. Given that we are the ones with the power, it is up to us to recognise the difference. The great thing about social media was how it gave a voice to voiceless people. We are now turning it into a surveillance society where the smartest way to survive is to go back to being voiceless.

• The new paperback edition of So You’ve Been Publicly Shamed by Jon Ronson is published by Picador at £8.99 on 31 December 2015. To order a copy for £7.19 go to bookshop.theguardian.com or call 0330 333 6846. Free UK p&p over £10, online orders only. Phone orders min p&p of £1.99.