The US Census Bureau probably isn’t the first federal agency you’d pin for a scandal.

Yet that’s exactly what appeared to happen on Tuesday, when the Census Bureau sent a report to Congress suggesting that the 2020 census will include sexual orientation and gender identity, only to later put out a correction noting that sexual orientation and gender identity will not be included in the decennial census or the supplemental American Community Surveys.

LGBTQ groups were furious, saying that the Trump administration had “erased” LGBTQ people from the biggest national survey.

On Wednesday, the Census Bureau tried to clarify what happened. As it noted, the Census Bureau has never included sexual orientation or gender identity in these surveys — not even under President Barack Obama, who was a close ally to LGBTQ people.

According to the bureau, the problem is that under the law, there’s just no mandate to collect census data on LGBTQ people. “In order for a subject to be included, there must be a clear statutory or regulatory need for data collection,” US Census Bureau Director John Thompson, who was appointed by Obama, wrote in a blog post.

So the census collects data on race, gender, age, relationship, and homeowner status because it’s mandated by laws or regulations — which is why we do know from the census, at least, how many households are headed by same-sex couples. And many of those categories are required by laws and regulations because they’re part of certain social or political programs, “from providing apportionment and redistricting data as part of our representative democracy, to helping distribute more than $400 billion in federal funds annually,” Thompson wrote.

But sexual orientation and gender identity aren’t required under these rules. So after reviewing requests to include sexual orientation and gender identity “to determine if there was a legislative mandate to collect this data,” Thompson wrote, the bureau “concluded there was no federal data need to change the planned census and ACS subjects.”

Meghan Maury, criminal and economic justice director at the National LGBTQ Task Force, took issue with Thompson’s claims. She emailed a statement, citing a previous federal report:

[H]is blog is misleading when it states the standard for inclusion of subjects in the American Community Survey (ACS). The blog states that there must be a “statutory or regulatory mandate” in order for questions to be included. Although many of the included questions are mandatory or required under federal law, a number of questions are included based on programmatic need — “the data are needed for program planning, implementation, or evaluation and there is no explicit mandate or requirements.” … At the very least, we call on the Census Bureau to apply the same standard to inclusion of questions on sexual orientation and gender identity as it does to other questions on the ACS. There is a clear programmatic need for these questions, as laid out by federal agencies in the process mentioned by the Bureau.

The bureau’s decision is surely a disappointment for LGBTQ advocates, who have been arguing for years that the census should include sexual orientation or gender identity. This data could no doubt be very useful for researchers: Not only could it be used to gauge just how many LGBTQ people live in the US, but it could be matched with other survey data to get a better idea of LGBTQ people’s outcomes, from health to criminal justice. After all, it’s going to be hard to solve a problem if you don’t know what the problem exactly is.

Yet the Trump administration has taken steps to exclude LGBTQ people from federal surveys. Recently, for example, the Department of Health and Human Services moved to exclude sexual orientation from a national health survey of older Americans.

But according to the Census Bureau, the issue with the census and the American Community Surveys ultimately comes down to Congress — particularly the fact that Congress has never asked the bureau to collect this data as part of its federal surveys. If that’s the case (and some LGBTQ advocates dispute this), the fundamental problem is the law.

Update: Added comments from the National LGBTQ Task Force.