WASHINGTON—The Supreme Court appeared deeply divided on whether the Trump administration can add a citizenship question to the 2020 census form, with the court’s conservative majority voicing skepticism of legal challengers who say adding the question will depress the count and is unlawful.

The decennial census, mandated by the Constitution to count all U.S. inhabitants regardless of legal status, is used to reapportion House seats among the states based on their population, as well as draw federal, state and local election maps. It also serves a multitude of other purposes, from the allocation of more than $600 billion in annual government funding to health, educational and infrastructure planning.

U.S. Solicitor General Noel Francisco, whose office appealed lower court rulings against the administration’s citizenship question, repeated an argument on Tuesday that Commerce Secretary Wilbur Ross, whose department includes the Census Bureau, has made previously. Mr. Francisco said the question was added to the basic census form to improve compliance with the Voting Rights Act, which requires information on the number and location of minorities who are eligible to vote—and are by definition U.S. citizens.

Liberal justices jumped in quickly to scoff at that rationale, which a federal district court in New York found was a pretext for adding the citizenship question. The lower court found that plans for the question apparently began in early 2017, including in conversations between Mr. Ross and other administration officials at the time, including White House strategist Steve Bannon, Attorney General Jeff Sessions and Kris Kobach, who served on a now-defunct Trump commission focused on purging voter rolls.

“For 65 years, every secretary of the Department of Commerce, every statistician, including this secretary’s statistician, recommended against adding the question,” said Justice Sonia Sotomayor, the day’s most active questioner. She said study after study showed that adding the citizenship question would reduce census response rates and make the population count less accurate. “This is about 100% that people will answer less,” she said. “This is a solution in search of a problem,” she added.