The House Appropriations Committee narrowly voted down funds sought by President Reagan to resume production of chemical weapons but acceded to his last-minute plea not to cut further his Strategic Defense Initiative yesterday.

Both actions occurred on the fiscal 1986 defense spending bill, which funds military programs this fiscal year. The measure, approved by voice vote, effectively freezes military spending at last year's level of $292 billion.

The 26-to-24 vote to eliminate $164 million for chemical weapons was an unexpected rebuff for Reagan, who last June was able to persuade the full House to end a 16-year moratorium on production of deadly nerve gas.

The 229-to-196 vote in June occurred on a bill that authorizes, but does not provide, the actual dollars for military programs in fiscal 1986, which began Oct. 1. The bill approved by the panel yesterday provides the actual funding but must be passed by the full House.

Nerve-gas opponents said yesterday that they were able to prevail on the spending bill in committee because several lawmakers who had voted on the House floor for chemical weapons production changed their minds.

The June bill delayed funding for two years and attached several strict conditions on resumption of chemical weapons production, but most of them were dropped in a House-Senate conference committee.

Rep. John Edward Porter (R-Ill.), who led the fight against production, said, "I think a lot of people feel that they have been had" and did not want to release nerve-gas funds if there were a chance that no conditions would be attached.

Porter and other opponents said they expect a major battle on the issue when the appropriations bill comes up for consideration in the full House, possibly as early as next week.

On the authorizing bill in June, the administration mounted a full-court lobbying effort, capitalizing on widespread congressional anger about the hijacking of TWA Flight 847 and the desire of some Democrats to appear more pro-defense.

Porter said he expects a similar effort on the appropriations bill but suggested that a different political climate might make passage tougher for the administration. "It'll be a tough fight," he said.

On the SDI missile-defense proposal, known as "Star Wars," the committee agreed to provide $2.5 billion after voting, 31 to 23, against an amendment that would have cut funding for the controversial research program to $2.1 billion.

The amount voted by the committee was less than the $3.7 billion originally requested by Reagan last February but identical to what the House approved in the defense authorization in June.

Concerned about efforts to reduce SDI funding further, Reagan called Appropriations Committee members to the White House Tuesday and told them that cuts below $2.5 billion would hurt his position at the Geneva summit with Soviet leader Mikhail Gorbachev next month.

SDI supporters made the same point yesterday.

"The worst thing we can do is to be an opponent to the president at a time when he is facing the other superpower," Rep. Tom Loeffler (R-Tex.) said. "Let us give the president everything within his power so he has in his hip pocket what he needs."

Rep. Robert J. Mrazek (D-N.Y.) countered, "I don't think this will hurt the president. His pocket is stuffed with a whole host of programs" approved by Congress.

SDI opponents, led by Rep. Vic Fazio (D-Calif.), also argued that the program had received $1.4 billion in fiscal 1985 and that $2.5 billion was too great an increase in one year. Opponents said they expect to fight the issue again when the spending bill reaches the floor.