Barilla may have 206 different types of pasta, yet it looks as though it has never heard of diversity. Chairman Guido Barilla has landed his eponymous brand in a scalding hot water that could do it long-term damage.

“For us, the concept of the sacred family remains one of the basic values of the company,” he told Italian radio. “We will not do advertising with homosexuals, because we like the traditional family. If gays do not agree, they can always eat pasta from another manufacturer.”

“Consumer action - and social media - brought Barilla to its knees”

Within hours, LGBT groups took him up on his offer. A global Boycott Barilla petition was launched, complete with a list of the company’s other brands, and the hashtag #boicottabarilla was soon trending on Twitter in several languages, inspiring tweets such as “Straight pasta for classic families” and “Oh, you’re straight? Well, so is spaghetti until it gets hot and wet.”

Rival brands were quick to take advantage of Barilla’s gaffe, posting gay-friendly promotional messages on social media sites that creatively exploited pasta shapes. Buitoni arranged six tortellini alongside gendered markers made from tagliatelle - one set male and female, one male and male, and one female and female - alongside a simple phrase: ‘Pasta for all.’

Bertolli used a similar message, but added an amusing graphic of assorted pasta shapes in different configurations of ‘couples’ attending what appeared to be a two-penne/same-sex wedding.

Guido Barilla apologised within days, posting a video on Facebook saying he respected everyone, “including gays and their families”, but his remarks had gone viral. The power of consumer action - and social media - had brought even Italy’s biggest pasta brand to its knees.

But competitors should think twice before they crow too loudly. It wasn’t long before Buitoni’s status as a Nestlé-owned company was being retweeted, along with reminders that Nestlé’s baby milk marketing activities don’t make it the favourite brand of development charities and campaigners.

The ethics and values of brands are under more intense, informed scrutiny than ever before. The Barilla debacle shows that even the biggest companies must tread carefully.

Joanna Blythman is a journalist and author of What to Eat