The Department of Housing and Urban Development is going to stop viewing itself as a social agency and start taking people to court if they don't repay their federally subsidized home loans, HUD Secretary Samuel R. Pierce Jr. said this week.

The former administration, however, initiated a similar effort, a department spokesman said.

"I want to take these people to court, and get back the money they owe the government," Perce said in a breakfast meeting Wednesday with reporters. This is part of a more businesslike approach he would like to bring to the department, the secretary added.

"If we make a deal on a loan, it's a deal on a loan -- just like a bank," Pierce said, adding that a bank would sue borrowers for nonpayment and so will he.

The HUD secretary specifically referred to rehabilitation loans, which are provided through city governments to low- and moderate-income persons in urban redevelopment areas at a 3 percent annual interest rate. This is one of the largest of HUD's loan programs and one in which delinquencies have been most acute, HUD spokesman said later.

In addition to court action on unsecured loans, HUD now is moving for foreclosure on secured loans, HUD public affairs officer Leonard Burchman said.

HUD officials believe this crackdown already is working. For last month alone, HUD collected $800,000 in delinquent debt, Burchman said.

A push to reclaim delinquent debt through litigation actually started during the last administration, however, another spokesman said, but added the current administration has intensified the effort. A $61 million delinquency in rehabilitation loans has been reduced to $20 million over the past 16 months, he said.

In his rare meetings with the press, which the secretary said may become more frequent now that he is able to leave his office and travel more, Pierce said previous HUD administrations "viewed themselves as social agencies" and therefore didn't enforce payment on HUD subsidized loan programs.

"It was just an attitude," Pierce said. "It was a giveaway almost" rather than a loan program because of lack of enforcement.

The Federal Home Administration, which has come under fiscal attack by the Office of Management and Budget, will not be dimished during the Reagan administration, Pierce said, but he added that it is unlikely to grow, either. FHA is "one of the best-programs HUD ever had," he declared.

Pierce also maintained that one reason for rising housing costs is overregulation of building at the local level, an argument made by the building industry in recent years. Too-stringent building codes "that have nothing to do with safety" can add as much as 20 percent to the price of a new house, he contended. He said he was not referring to federal regulation, however.