A small group of House Democrats yesterday dealt what could become a death blow to Carter administration efforts to secure military access to Somalia's ports and airfields.

Aides said a caucus and poll of Democrats on the House Appropriations subcommittee on foreign operations produced a majority in favor of rejecting "at this time" the administrations' request to shift $20 million in military sales credits to Somalia.

The Democrats' action came just one day after officials from the departments of State and Defense appeared before the subcommittee to make the administration's case for reprogramming money from the fiscal 1980 budget as part of a deal with the strategically located but politically controversial African country.

The administration's case made by Undersecretary of State Matthew Nimetz and Deputy Assistant Secretary of Defense Robert H. Pelletreau.

Aides to several congressmen said yesterday the general impression of the hearing was that the administration's arguments were not well presented, and that the spokesmen did not offer enough evidence to support the need for a military relationship with Somalia, given that country's political problems with its neighbors in Africa.

Committee sources say that a letter, to be signed by subcommittee chairman Clarence D. Long (D-Md.), will be sent to Secretary of State Edmund S. Muskie. It will say that the panel will approve a requested $5 million reprogram for economic support but that the case made thus far did not justify the $20 million in sales credits. The letter would invite the administration to come back if it felt it had a better presentation to make or more evidence to cite.

The subcommittee is the key panel on all reprogramming actions. If the disapproval stands, it is unlikely the administration would be able to follow through on its deal with Somalia.

The administration wants access to the Somali facilities as part of its effort to set up staging posts in Oman, Kenya, Somalia and Egypt that could be used in an emergency in the nearby oil-rich Persian Gulf.

It took the White House eight months to get the Somalis to agree. But Somalia remains in a bitter feud with neighboring Ethiopia, which is backed by Cuba and the Soviets, and there are concerns here and in Africa that the United States could be dragged into that conflict through the facilities arrangements. Thus, some argue that the new access is not worth the risk.

Growing skepticism about the link with Somalia was also revealed in a letter to Muskie opposing the move signed by the 15 members of the congressional Black Caucus.

The letter said the U.S. actions could exacerbate tensions in the area and fuel the conflict between the two African countries.

In addition, aides said yesterday that eight more members of the full House Foreign Affairs Committee -- six Democrats and two Republicans -- joined five Democrats and two Republicans who wrote Muskie opposing the shift of the money for arms purchases by Somalia.