Two of the country's biggest beer companies are withdrawing their sponsorships of upcoming St. Patrick's Day parades because gay and lesbian groups aren't allowed to march openly.

Sam Adams, owned by Boston Beer Co (SAM), will no longer be sponsoring the parade in Boston on Sunday, while Heineken (HEINY) has pulled its sponsorship from the New York City parade on Monday.

"We believe in equality for all," a Heineken USA spokeswoman said.

Sam Adams said it had tried to convince Boston's parade organizers to modify their rules and allow LGBT groups to march.

Related: Obamacare will cover same-sex spouses

"We were hopeful an agreement could be reached to allow everyone, regardless of orientation, to participate in this parade," the company said in a statement. "However, given the current status of the negotiations, this may not be possible."

The South Boston Allied War Veterans Council, which is organizing the parade, said in a statement on its website that it is not opposed to LGBT (lesbian, gay, bisexual and transgender) people, it just doesn't allow sexual orientation to be displayed.

Related: Chick-fil-A CEO's equality award sparks backlash

It said lesbian and gay veterans who had wanted to march as part of an LGBT veterans group could still march in the parade under the condition that they wouldn't identify themselves as gay with signs or t-shirts.

"We invite all to join us to celebrate this historic event, but we must maintain our guidelines to insure the enjoyment and public safety of our spectators," the group stated.

Even the cities' mayors have reservations. New York Mayor Bill de Blasio is boycotting the parade, while Boston Mayor Martin Walsh is reportedly trying to convince organizers to change their policy before he makes his final decision.