The Federal Election Commission yesterday rejected the recommendation of its staff -- and a warning about allowing presidential candidates to skirt state spending limits -- and approved the practice of campaigns' writing off half the cost of some television commercials as fund-raising expenses.

By a 4-to-2 vote, the commission directed its general counsel to draft language saying the 50 percent exemption from individual state spending limits is acceptable, even if the fund-raising solicitation in the ad is limited to a few words.

The decision, in effect, gives after-the-fact approval to tactics used in the recent Iowa caucus by two Democratic candidates, Rep. Richard A. Gephardt (Mo.) and Gov. Michael S. Dukakis of Massachusetts. Gephardt was able to subtract more than $100,000 from the state's $775,000 spending limit by allocating half the costs of early commercials not to state advertising but to fund-raising. There are no state limits on fund-raising expenses. Dukakis saved about $40,000 from the limit that way.

If the FEC had taken its lawyers' advice for only a 5 percent writeoff, the two campaigns' spending in Iowa would almost certainly have exceeded the limit.

Commissioner Joan D. Aikens, who joined Lee Ann Elliott in voting against the 50 percent rule, said of the majority position: "I think we are absolutely blowing the state limits out of the water. If we are going to do that we should tell Congress we are not going to enforce the state limits. . . . I think this is sanctioning creative accounting to get around the limits."

Commission Chairman Thomas J. Josefiak, a Republican, joined the three Democratic members in approving the 50 percent allocation.

The FEC was acting in response to a request by the campaign of Sen. Albert Gore Jr. (D-Tenn.), which said it wanted to know if it could run similar commercials, and write off half the cost, in the upcoming Colorado caucus. It was clear, however, that Gore campaign officials were really trying to attack what they considered their rivals' effort to evade the limits.

Robert F. Bauer, Gephardt's campaign lawyer, said, "We were confident the actions we took were fully consistent with the law, and the commission has clearly ruled in our favor."

Arlie Schardt, Gore's press secretary, said, "We're glad the FEC has clarified the law. That's all we asked." He added, "I'm glad the FEC is not interpreting the ABM treaty."

FEC staff attorneys had argued that a 5 percent allocation "would be reasonable" for television commercial fund raising because "the only appeal to 'contribute' occurs in the final three seconds of a 60-second spot."

But the majority of the commissioners disagreed that counting the number of words in a commerical is the way to measure its intended fund-raising potential.

Commissioner Danny L. McDonald said that reasoning looked appealing at first, but added, "I don't accept that as political reality." He said candidates often have a dual purpose in their appeals, both for support and funds.

Commissioner John Warren McGarry said he is worried how the decision would "impact on campaigns out on the firing line in the middle of a heated presidential campaign."