By David Morgan

WASHINGTON (Reuters) - The Republican-controlled U.S. House of Representatives voted on Tuesday to protect the identities of wealthy individuals and others who make anonymous, or "dark money," donations to politically active nonprofit groups.

The measure, which drew lobbying support from billionaire industrialists Charles and David Koch, was approved in a 240-180 vote along party lines. It would prohibit the Internal Revenue Service from collecting the names and addresses of donors who contribute $5,000 or more to 501(c) organizations, a name that refers to the tax code section that covers them. The action sent the bill on to the Senate.

Although the measure would apply to all 501(c) tax-exempt groups, such as universities, hospitals and charities, politically active nonprofits are the intended beneficiaries.

Republicans said the legislation would prevent the Internal Revenue Service from targeting conservative groups following 2013 revelations that Tea Party organizations were subjected to extra scrutiny.

Political spending by nonprofit groups including the Koch- aligned Americans for Prosperity has grown dramatically since 2010, when the Supreme Court opened the way to unlimited spending on political campaigns by individuals, corporations, unions and other groups in its landmark Citizens United ruling.

The White House on Monday said it opposed the bill, the Preventing IRS Abuse and Protecting Free Speech Act, claiming it would constrain the IRS from enforcing tax laws and reduce transparency among private foundations.

Democrats argued that the legislation could make it easier for foreign entities to finance political campaigns inside the United States.

Charity regulators have also warned that the loss of donor information would make it harder to protect the public against charity fraud. The change would reduce available information on a range of organizations, IRS data shows.

Republicans said the bill is necessary to protect donors from potential leaks that could subject them to harassment. Donor identities are not supposed to be released to the public, hence the term "dark money."

But leaks have occurred, including the 2012 release of donors to the conservative National Organization for Marriage that resulted in a settlement requiring the IRS to pay the organization $50,000.

Supporters of the legislation also pointed to signs that the IRS may seek to end the disclosure requirement on its own.

Nonprofit groups could spend more than $500 million on this year's presidential and congressional elections, up from $10 million in 2008, according to the nonpartisan Center for Responsive Politics.

House Republicans are also pushing to censure and impeach IRS Commissioner John Koskinen for allegedly failing to cooperate with a probe of the IRS scandal.

(Reporting by David Morgan; Editing by Leslie Adler)