The federal government, which has had troubles for that past two years figuring out how much money it will spend, will tell Congress Monday that on July 1 it again overestimated the 1977 deficit, this time by between $2 billion and $3 billion.

That means the deficit for fiscal 1977 (which ends Sept. 30) will be about $45 billion. The Carter administration's first budget revisions last February estimated the deficit at $68 billion.

But July 1, with only three months to go in the year, administration officials had trimmed the deficit estimate to $48.1 billion and now they will trim it again.

The inability of the government to spend as much as it wants to worries many economists because Congress and the President fashion their budget to reach a desired economic impact.

When Congress passed its third and final 1977 budget in February it called for a deficit of $52.6 billion.

Ironically, if the deficit is $45 billion or so for the current spending year, it will be close to the $43 billion deficit President Fort proposed when he sumitted his budget in January 1976.

He was sharply criticized then by many Democrats who charged he was being too tight-fisted with many of his programs because the economy still needed assistance in the form of heavy federal spending to recover from the 1974-75 recession.

By last January, whne Ford submitted his proposed 1978 budget days before leaving office, his administration said it thought the government would spend $57.2 billion more than it took in. A month later, President Carter boosted the deficit estimate the $68 billion.

Government officials said one of the reasons the deficit estimate has narrowed so much in only four weeks is the unexpected deposit of about $700 million by foreign governments into the Defense Department's military assistance trust fund.

When foreign governments buy weapons or services from the United States under military assistance programs the governments first depost the money they want to spend in special trust funds administered by the Pentagon.

The money gets transferred to the Pentagon accounts from the trust fund the the Pentagon pays say the contractor or perhaps credits the account of the Army Corps of Engineers.

One government official said he was "mystified" by the unexpected deposits in the military trust funds, most of which apparently came from Saudi Arabia.

"How many $700 million of unexpected collections could show up is beyond me," the official said.