The resurgent real estate market helped to generate record profits forthree Washington-based companies.

The Federal Home Loan Mortgage Corp. (Freddie Mac), which makes a secondary market in residential mortgages, yesterday reported a 30 percent gain in first-quarter earnings over a year ago to $26.6 million.

President Kenneth J. Thygerson attributed the performance to the corporation's expanding operations, which include the purchase of several new types of mortgages. He added that profits were actually better than stated because earnings for the first quarter of 1982 included a nonrecurring gain. Freddie Mac also paid a dividend of $6 million to the 12 Federal Home Loan Banks that own all of its stock.

Federal Realty Investment Trust announced a 95 percent increase in net income during the quarter to $1.4 million (25 cents a share), of which $99,000 came from the gain on the sale of a land parcel. Net cash flow from operations rose by 49 percent. Revenues were up by 13 percent to $4.5 million.

President Steven J. Guttman cited short-term investments and higher rental income from trust properties, coupled with tightly controlled property operating expenses, as reasons for the increase. The equity real estate investment trust derives its income from shopping centers in this area and five states.

MIW Investors experienced a 184 percent increase in net income during its fiscal year ended March 31 to $1.2 million (32 cents a share) from $427,500 (11 cents) the previous year.

The trust showed a better return on its investment portfolio, a significant portion of which had been nonearning, or only partially earning. Also, the sale of a land parcel and the repayment of several mortgage loans sharply improved the trust's cash position.

Formally known as Mortgage Investors of Washington, MIW Investors was recapitalized two years ago with the help of a group of European private and institutional investors. It owns shopping centers, undeveloped land and mortgage loans, and participates in development joint ventures.