The nation ran another large trade deficit in December to climax a year in which imports exceeded exports by a record $26.7 billion, the Department of Commerce reported yesterday.

The agency said that the nation imported $2.03 billion more in December than it exported, compared with a $2.08 billion imbalance in November.

The previous record trade deficit was in 1972, when imports exceeded exports by $6.4 billion. In 1976 the trade deficit was $5.9 billion.

The nation's heavy reliance on imported oil more than accounts for the trade feficit. Oil imports alone last year were $42.1 billion, 29 percent of total U.S. foreign purchases. In 1976 the nation bought $32.2 billion of foreign oil.

But the relatively strong economic recovery in the United States, coupled with slow growth abroad, also has contributed to the large trade deficit.

A growing economy creates demands for foreign goods. U.S. demand for imports grew from $120.7 billion in 1976 to $146.8 billion in 1977. Exports grew only $5.3 billion - from $114.8 billion to $120.1 million - over the same period.

Because most foreign countries are growing more slowly than the United States, demand for American goods has been increasing very slowly.

Foreign manufacturers also have aggressively tried to sell proudcts in the United States because of slack demand in their home markets.

The administration has been pressuring major world economies - principally Japan and West Germany - to take steps to boost their economic growth rates, in part to stimulate demand for U.S. goods and increase their need to export to the United States.

After oil is taken out of the U.S. trade ledger, the trade balance is in surplus by $15.4 billion for 1977, smaller than the $26.3 billion surplus the nation recorded after oil was taken out of the 1976 trade figures.

Commerce Department Chief Economist Courtenay M. Slater said the continued reliance on foreign oil means that a "large deficit must again be expected in 1978."

The large U.S. trade deficit has been the major reason behind the sharp decline in the dollar in recent months. As foreigners' dollar holdings increase, the price of the dollar in other currencies - especially the deutschemark and yen - declines.

In December, both imports and exports rose sharply, "reflecting above normal activity at Gulf and East Coast ports which had been affected by the longshoremen's strike in October and November," Slater said.

Exports rose from $9.3 billion in November to $11 billion in December, while imports increased from $11.4 billion to $13.1 billion. Both the import and export levels were records.

Petroleum imports were $3.2 billion in December, down from $3.5 billion in November. For the year as a whole, imports of oil averaged about $3.5 billion a month.

The biggest increases in exports occurred among foods, especially sugar. Importers were trying to beat higher tariffs on sugar, which are scheduled to take effect this spring.