The Commodity Futures Trading Commission approved yesterday the sale to the public of stock index futures contracts that will permit investors to speculate directly on the rise and fall of the stock market.

The commodity commission voted 4 to 1 to permit the Kansas City Board of Trade to market a futures contract based on the Value Line Index of 1,700 stock prices.

Stock index futures will work just like futures contracts for soybeans or pork bellies except that the commodity traded will be a hypothetical portfolio of stocks. A speculator who buys stock index futures will make money if the stock index goes up and lose if it goes down.

Denounced by some critics as nothing more than gambling on the stock market, the new stock market speculation vehicle was approved despite urgings from two congressmen to delay a decision and the threat of a confrontation with the Federal Reserve Board.

The Federal Reserve contends that its authority to regulate credit for the purchase of securities gives it the power to set stock index futures margins--the amount of money investors must put up to buy a contract.

The board has not claimed jurisdiction previously over commodity margins which, unlike stock margins, are set by the commodity markets themselves. Fed Chairman Paul A. Volcker met on Friday with CFTC Chairman Philip McBride Johnson, but Johnson said yesterday they failed to end the dispute.

After the meeting between Johnson and Volcker, officials of the Kansas City exchange offered "voluntarily" to increase the margin on their Value Line Contract from $4,000 to $6,500. The exchange's directors approved the increase at a special meeting yesterday morning, minutes before the CFTC action.

Kansas City Board President W.N. Vernon said the exchange "has no deal" with the Fed or CFTC over margins and might go to court to challenge the Fed if it does dictate the down payment on the new investments. "We have various options, certainly going to court is one of them," said Vernon.

The Federal Reserve Board met yesterday morning to discuss the margin dispute, but there was no indication that the board changed its stand.

There has been intense political pressure on the Fed from supporters and critics of the Kansas City plan. Sen. Bob Dole (R-Kan.), chairman of the Senate Finance Committee, urged the Fed to stay out of the margin issue, while support for controls over margin was voiced by Rep. John Dingell (D-Mich.), chairman of the House Energy and Commerce Committee, which oversees stock trading, and Rep. Benjamin Rosenthal (D-N.Y.), head of a subcommittee that has been highly critical of the CFTC.

Some time ago, the Fed served notice that it intended to set margins on stock index futures. The board asked the CFTC to delay the effective date of a stock futures contract for six months after approval to give the Fed time to set margins.

The commodity commission rejected the request and approved the Kansas City proposal effective immediately. Vernon said sales of Value Line Futures will begin next Wednesday.

Although stock index futures will allow small speculators to profit from the rise and fall of the stock market, their main economic benefit will be to permit big investment managers to hedge the risk of buying stocks. Commissioner Susan Phillips predicted that stock market specialists, securities dealers and pension funds will use the new investments.

The only vote against the Kansas City proposal was cast by Commissioner James M. Stone, the Democrat who was chairman of the CFTC before Johnson was appointed by President Reagan.

Stone said he fears stock index futures will drain money away from direct investment in the stock market and that investors will not be protected adequately. "We are providing less protection than exists on other securities investments," which are regulated by the Securities and Exchange Commission, Stone said.

Citing disparities between SEC and CFTC regulations, Stone warned of "the tendency for business to go to that system which is weaker." He said the commodity agency lacks SEC rules that require training and supervision of sales personnel, ban insider trading and ensure that customers are sold only investments "suitable" for their personal finances.

"This is not a question of one agency's regulatory standards being looser than another's," retorted Chairman Johnson, who cited several specific CFTC regulations that he said provide customers more protection than SEC rules, including limits on holdings of speculators and segregation of customer funds.