Construction spending shot up 2.2 percent in November, the biggest increase in nine months, as the building industry benefited from widespread gains in both residential and nonresidential construction, the government said yesterday.

The Commerce Department reported that spending on new construction rose to a seasonally adjusted annual rate of $419.5 billion in November, an increase of $8.9 billion from October.

It was the biggest one-month gain since a 4.4 percent rise last February. Construction spending had fallen 0.1 percent in October after posting a 2 percent September advance.

Analysts credited part of the sharp rebound in November to unusually warm weather in many states, but they said the advance may also be signaling better days for at least part of the construction industry.

"The good increase in nonresidential construction is probably a sign that we have seen the worst of the tax-law induced cutbacks in that area," said David Wyss, an economist with Data Resources Inc. of Lexington, Mass.

Construction spending was depressed in 1987 because of the new tax law, which reduced many incentives for investing in real estate. The tax changes, coupled with widespread overbuilding in the apartment and office sectors, led to sharp drops in activity in these areas in 1987.

While construction spending overall has risen by 2.9 percent in the first 11 months of 1987, it was down 18 percent in the apartment sector and 11 percent in the office sector.

Michael Sumichrast, an economist and publisher of the Commercial Real Estate Report, said office building would decline another 20 percent in 1988 and this weakness would help to drag overall nonresidential construction down by close to 5 percent.

But Sumichrast said several categories including factories, hospitals, private schools and public works projects will show increases for the year, based on his surveys.

"The major problem is still office buildings, but there is an indication that vacancy rates in that sector are bottoming out," he said.

The 2.2 percent overall increase in November was led by a 6.9 percent jump in spending for nonresidential construction, which rose to a seasonally adjusted annual rate of $96.2 billion.

Spending for residential construction was also up a healthy 1.1 percent to an annual rate of $207.1 billion. The residential gain included a 0.9 percent increase in construction of single-family homes and a 2.5 percent rise in construction of multifamily housing.