Washington-area inflation rose 2 percent for the two-month period ending in March, mostly due to higher costs of housing, transportation and energy, the Labor Department reported yesterday.

The local inflation rate was higher than the 1.8 percent rate for the nation during that period, the Labor Department said. The inflation rate during the last 12 months was 9.8 percent. The consumer price index at the end of last month was 262.3, meaning that an item costing $1 in 1967 now costs $2.62.

Housing costs, particularly for mortgages, house maintenance, repairs, natural gas, furnishings, fuel oil and the homes themselves, rose 2.6 percent and accounted for more than half of the local increase from January to March. Prices declined moderately for electricity, housekeeping supplies and telephone services, the Labor Department said.

However, transportation costs, reflecting higher charges for gasoline and airline fares, rose 2.7 percent.

Food costs rose 0.7 percent, a decrease from the 1.1 percent rise recorded for December and January and the 1.9 percent increase for the two months ending in November.

The cost of eating away from home rose 1.3 percent and grocery store prices increased by 1/2 percent, still a decline from the 1 1/2 percent increase in grocery-store costs recorded for the two months ending in January. Price increases for fresh fruits and vegetables, fish, seafood and poultry were partially offset by lower costs of beef, eggs, pork and dairy products, the Labor Department said.

One reason for the decline in meat prices was sluggish retail demand, said William C. Cook, supervisory economist in the Labor Department's food section. Cook also said that a good supply of eggs also drove those prices down.

"Pretty good prices increases" of fresh vegetables and fruit were caused partly by injury to Florida orange crops due to cold weather and rain damage to vegetables in Mexico, Cook said. In addition, sugar and coffee prices have dropped, Cook added.

Cook said his office doesn't predict future food prices, but availability of crops will depend a great deal on the water supplies this summer.

In addition, medical care costs rose 1.6 percent, reflecting higher charges for physicians' and dental services and personal care, entertainment and cigarette prices also rose. Prices declined for apparel, sports vehicles and pet expenses, the Labor Department said.

The average inflation rate for 18 selected metropolitan areas during the last two months was 1.8 percent, with the highest rate of 2.3 percent recorded in Baltimore, Boston, and Seattle-Everett area. The lowest inflation rate was a drop of 0.1 percent in Detroit.