The Commerce Department reported yesterday that the nation's economy grew at a 3.7 percent annual rate in the first quarter, half a percentage point faster than previously estimated.

The increase, which came as a suprise to many economists, was primarily the result of more government spending and bigger additions to business inventories than originally estimated.

The growth rate was substantially stronger than the 0.7 percent rate in the fourth quarter of 1985, but a number of private economists said the upward revision in inventories means that production was outpacing sales in the first quarter. As a result, future output likely will suffer somewhat, they said.

Many forecasters are predicting that the gross national product, adjusted for inflation, will rise at only about a 2 percent rate this quarter before growth accelerates in the second half of the year. Forecasters expect faster growth as a result of interest-rate declines, lower oil prices and a shrinking trade deficit, with the latter coming in the wake of the big decline in the value of the dollar on foreign-exchange markets.

Commerce also said that the GNP price index rose at a 2.3 percent rate in the first three months of the year, up only slightly from the previous 2.2 percent estimate. Prices for many goods and services rose less rapidly than in the fourth quarter, when the index increased at a 3.9 percent rate.

The White House issued a statement welcoming the revisions: "This -- coupled with continuing good economic news from virtually every sector -- makes for a solid first quarter. . . . Today's GNP figures reflect the sustained strength of the American economy and lend further credence to our forecast of 3.1 percent GNP growth for 1986. Growth, as measured by fourth-quarter 1986 over fourth-quarter 1985, is expected to be 4 percent."

Private analysts took a dimmer view, noting a sharp decline in business investment in new plants and equipment and the large rise in the share of production going into inventories rather than being sold to final users.

One strong sector was consumer spending, which accounts for nearly two-thirds of total GNP. Personal-consumption spending rose at a 4.2 percent rate compared with a scant 0.1 percent in the fourth quarter. The trade balance also improved, adding to demand for domestically produced goods and services.

But nonresidential business fixed investment fell at a 13 percent rate, largely because of large cutbacks in exploration and production spending by the oil and gas industry in the wake of falling oil prices.

Nonfarm business inventories rose at a $39.1 billion rate, up from $19 billion in the fourth quarter and from $3.1 billion in the third. The first-quarter rise was reported earlier as at a $29.7 billion rate.

Pointing to that rise in inventory accumulation, economist Stephen Roach of Morgan Stanley & Co. said, "This is not a revision [in GNP] that indicates strength in the economy. This reflects ballooning inventories in the auto sector and is an ominous development."

Auto manufacturers began to trim production even before the first quarter was over in an effort to bring output more in line with sales. The number of cars assembled rose again in April, and some analysts believe further production cuts will be required sooner or later to keep inventories in line.

Christopher Caton, an economist at Data Resources Inc., said that the large addition to inventories likely would cause DRI to revise its forecast of 2.6 percent growth this quarter downward "a bit." And he added that there was nothing in the latest figures to cause an upward revision in the DRI forecast for coming quarters.

DRI expects real output to increase at a 3.6 percent rate in the third quarter, then drop back to a 2 percent rate in the fourth quarter. The fourth-quarter dip is expected, Caton said, as a result of cuts in federal government spending required to meet budget-deficit reductions.

The Commerce Department said that, after the latest revisions, GNP -- the total output of goods and services and net earnings on investments abroad -- was produced at a seasonally adjusted annual rate of $4.121 trillion in the first quarter.

In a separate part of the report, the department said that corporate profits from current production increased $11.1 billion to an annual rate of $314.2 billion. By the same measure, profits had decreased $6 billion in the previous quarter.