In a locked conference room on the sixth floor of the Department of Housing and Urban Development's headquarters here, representatives of two accounting firms and a dozen or so government officials gathered Tuesday to end the era of huge federal housing subsidies as they allocated the last below-market-rate mortgage funds under the Government National Mortgage Association (Ginnie Mae) Tandem program.

Using index cards with data on the 769 projects competing for funding and computer print-outs of random numbers, mortgage association officials gave away by lottery $907.7 million in subsidized mortgages to 246 of the competing projects. The funds were the last of a total fiscal 1982 appropriation of almost $2 billion, and may be the final allocation under the program if Congress approves the Reagan administration's plan to abolish it along with most other federal assistance for housing production.

The sponsors of the 246 winning projects will be entitled to mortgages at a 7 1/2 percent interest rate if their projects are also subsidized under the Section 8 housing assistance program for low-income families and 9 3/4 percent if their projects are unsubsidized. Selection in the lottery virtually guarantees the feasibility of their projects while the housing industry generally flounders because of prohibitively high interest rates for unsubsidized financing.

The sponsors of the 523 projects that were not selected in the lottery now face the uncertain task of finding a way to use tax-exempt bonds or conventional financing. The 433 projects not selected that have commitments for Section 8 subsidies for new construction and substantial rehabilitation are also under pressure from HUD to find feasible financing quickly or lose that funding, too.

With the fate of so many projects on the line, Ginnie Mae went to great lengths to insure that the Tandem lottery was totally random. "It's going to be absolutely by chance," Ginnie Mae President Robert W. Karpe said as the lottery got underway. "Just so we are absolutely sure nobody could possibly pick any specific project by reason of geography or by any kind of favoritism."

All the competing projects were designated by code numbers on index cards, which were then assigned computer-generated numbers by the accounting firm of Price Waterhouse. The firm of Peat, Marwick, Mitchell and Co. then chose the winning projects by matching the randomly numbered index cards with a second list of random numbers. Ginnie Mae began informing project sponsors of the lottery results last week.

The lottery process was used only for the portion of the 1982 Tandem funds that remained after Ginnie Mae made commitments for all of the eligible projects in two priority funding categories. These included 11 projects that were associated with Urban Development Action Grant projects, and 206 projects that competed but were not chosen in the Tandem lottery held in 1981.

After the project sponsors present the necessary documentation and pay a commitment fee, Ginnie Mae will agree to purchase mortgages for their projects from private lenders at the below-market interest rates. Eventually, Ginnie Mae will sell the mortgages at a discount, giving investors a market rate yield and absorbing the loss as a subsidy.

On a nationwide basis, 2,871 projects had Section 8 subsidy commitments at the end of February but had not reached the construction stage, in many cases because of a lack of feasible financing. The 1982 Tandem funding will finance a total of 347 Section 8 projects. Another 888 projects will be financed by direct federal loan programs. That leaves about 1,636 Section 8 new construction and substantial rehabilitation projects that were either ineligible for Tandem funding, did not seek it, or were unsuccessful in the lottery.

In the area under the jurisdiction of HUD's Washington office, a total of 66 projects had Section 8 reservations but had not started construction by the end of February. Only 10 of those are to be financed by direct federal loans under the Section 202 program for housing for the elderly. Of the other 56 projects, 23 were eligible to compete for Tandem funding, while the other 33 would have to rely on tax-exempt bonds or conventional financing.

Most sponsors of Section 8 projects without commitments for Tandem or direct loan financing will attempt to get some break on interest rates by using tax-exempt bonds, which offer lower rates than conventional financing because the investors pay no tax on their interest income. Because tax-exempt bond rates are also at relatively high levels, HUD has implemented a financing adjustment factor to make projects feasible at interest rates of up to 12 percent by allowing rents above HUD's usual maximums.

The catch is that projects can only use the financing adjustment factor if they can obtain financing and start construction by June 1. As that deadline approaches, tax-exempt bond rates are still too high for many projects to be feasible, even with the financing-adjustment factor. Project sponsors are faced with the choice of putting in more of their own money to reduce the amount that must be financed or hoping for interest rates to drop to feasible levels in time to meet the June 1 deadline.

HUD, meanwhile, is planning to cancel commitments for projects that were not chosen in the lottery and cannot find other financing. The department expects to cancel commitments for some 52,000 units of Section 8 new construction and substantial rehabilitation. Some of the recaptured subsidy funds would be used to increase subsidy commitments for projects that do obtain financing. The rest of the funds, including additional money recaptured from canceled commitments for public housing and the Section 8 moderate rehabilitation program, would be proposed for recision. The administration is also proposing to rescind most of the fiscal 1982 appropriation for new Section 8 commitments.

Knowing the odds are against projects that did not obtain Tandem financing, District housing officials waited anxiously this week to learn the fate of the projects planned for the city that were entered in the lottery.

"It's really critical that we receive financing for those projects to go forward," said Rich Coward, a special assistant to Housing and Community Development Director Robert L. Moore. "That's where we are, with our fingers crossed."

While it's not as immediate a problem, the possible cancellation of Section 8 subsidy commitments for projects in the District also threatens the city's housing efforts.

"It places not only D.C. but a number of cities in a very precarious position," Coward said, citing a need for low-income housing that is "double, triple, quadruple" the supply.