West Germany's interior minister, 50-year-old Werner Maihofer, turned in his resignation here yesterday following heavy and persistent criticism of his agency's handling of the fight against terrorism.

The minister's forced resignation was the second stunning blow in the past three days believed to the Free Democratic Party - the vital junior partner of the much larger Social Democratic Party in the Ruling federal coalition government here.

Maihoffer was one of four Free Democrats who held top Cabinet positions in the government of Chancellor Helmut Schmidt.

On Sunday, the free democrats were knocked out of the parliament of two of Germany's 10 federal states when they failed to achieve the required 5 percent for representation in Lower Saxony and Hamburg.

The combination of events, but particularly the election results in the state's, has suddenly knocked West German politics into a period of uncertainty with potentially far-reaching and unpredicatable change.

The Free Democrats have not only been vital for governing at the federal level, to the Social Democrats but have also played crucial roles in one or two states in coalition with the conservative Christian Democrats.The prospect of the party being greatly diminised in its political power or possibly even disappearing in still more states may have considerable consequences for the kind of big party politics that has dominated West Germany for 20 years.

Maihofer's resignation was not unexpected, but the election losses and a sharply critical report on his ministry by an independent investigative agency published on Monday undoubtedly sealed his fate.

The report verified what had become well known here: that a tip that might have saved the life of kidnaped industrialist Hans-Martin Schleyer last fall was bungled because of lack of coordination between police and political authorities, despite large investments in new crime-fighting conputer technology.

The report, while it did not name Maihofer personally, was also generally critical of the management of the huge Interior Ministry.

The minister, a former law professor and a member of the Cabinet since 1972, has also come under fire from some Social Democrats for failure to control border police units.

Maihofer recently had to admit that border police, without his knowledge or permission, had been searching travelers leaving the country and taking down the names of those police decided had been carrying allegedly subversive or extemist-wing publications.

Last year, his ministry also came under fire for various bugging incidents, including one at the home of a nuclear physicist thought to have terrorist connections.

Maihofer is generally viewed as a liberal and somewhat to the left of his party, which generally is slightly more conservative than its government partner, the Social Democrats.

The minister has not been personally accused of supporting some of the more controversial deeds of his agency, but rather of failing to keep close tabs on them.

Meanwhile, Bonn political circles are still trying to digest the meaning of the state election results.

The defeat of the Free Democrats was largely because fringe parties of environmentalists pulled votes away. The environmentalists also did not win quite enough to be represented in the state parliaments, but they showed that the major parties thus far do not have enough political ingenuity to absorb the growing numbers of ecology minded voters.

The Social Democratic Party of Chancellor Helmut Schmidt won only 42.6 percent of the vote in the 1976 federal election and is in power only because the Free Democrats got the extra 7.9 percent If the image of the Free Democrats continues to take a pounding , the coalition would appear to be doomed in 1980, despite Schmidt's continued popularity.

Most importantly, the event raised doubts about what the Free Democrats stand for and the strategy of convenience they have used so successfully until now. They have joined with the Social Democrats at the federal level, but have also formed coalitions with Christian Democrats at state levels. Voters may now be rebelling at such political practicality.

Finally, their loss in Lower Saxony, where they were in a coalition with the opposition Christian Democrats, means that the opposition will now rule alone in that state and increase the power and prestige in Bonn of the state minister 47-year-old Ernest Albrecht, one of the rising young Christian Democratic stars who could be a candidate for chancellor in 1980.