(CNN) Sir Elton John is the latest celebrity to weigh in on North Carolina's controversial bathroom law, penning an essay for "The Hill" about what he calls a "discriminatory bill."

House Bill 2, known as HB2, has been criticized as being discriminatory toward transgender people. The statewide policy bans individuals from using public bathrooms that do not correspond to their biological sex and prohibits cities from passing anti-discrimination ordinances to protect gay and transgender identity.

The Justice Department has filed a civil rights lawsuit against North Carolina and several entertainers have canceled planned performances there in protest.

John, who married longtime partner David Furnish in 2014, writes in his essay that "This brand of ignorance deliberately shuts out the perspective of an already marginalized community."

"It's dangerous, and it goes beyond bathrooms," John says. "As the father of two children, I would hope their world is free of discriminatory, hateful legislation like North Carolina's."

"Forcing transgender people to use the bathroom of a gender with which they don't identify isn't just inconvenient or impractical," the musician adds. "For many, especially young students still grappling with their transition, it can be traumatic, and at worst, unsafe."

The legendary musician is a longtime AIDS activist and humanitarian who sees a correlation between the work his Elton John AIDS Foundation does and the fight against the bathroom law. He points out in his essay that "Transgender women are 49 times more likely to be living with HIV than the general population."

"That statistic on its face is startling, but when you consider the societal barriers these women face, it's hardly surprising," John writes. "Rampant employment discrimination pushing many into sex work as their only option for economic survival, lack of access to quality healthcare, constant discrimination -- it all adds up to create these overwhelming odds. These are the issues [North Carolina Governor Pat] McCrory and our other elected officials should focus on addressing."

Bruce Springsteen, Pearl Jam, Nick Jonas and Demi Lovato are just a few of the high profile acts who have canceled concerts in North Carolina in support of the LGBT community. The protests by celebs have cost the Greensboro Coliseum hundreds of thousands of dollars.