Votes in New York and Connecticut have done more than resurrect Edward M. Kennedy's faltering campaign. They have dealt a blow to Jimmy Carter's reelection prospects, if not his renomination.

For the first time in this presidential year Carter's political vulnerabilities have been exposed in a major election test area, one he will sorely need to remain in the White House.

Whether Carter's stunning defeats Tuesday represent a Humpty Dumpty-like fall, with the political pieces becoming increasingly difficult to put together again, cannot be answered now. But the elements that combined to crack his facade of political strength -- among them the economy, Iran and the apparent finality of the presidential choices next November, the U.N. resolution hassle -- are clear enough.

Something else stands out among the again-confounding news from the political campaign. In all the wild swings of affections, with last week's winners repeatedly being consigned to next week's defeat, the voters seem to have been struggling to make certain points. They are not going to be taken for granted, they are determined not to let their presidential selection go by default, and they are unhappy with the choices before them.

In New York and Connecticut, at least, these factors spell bad news ahead for the president.

Kennedy's victories were almost startling in what they say about voter attitudes and how swiftly they can coalesce and change. If the polls were in any way correct -- admittedly a dubious proposition in this year of faulty estimates -- a sudden and massive switch of preference occurred.

In New York alone it appears that something like 220,000 registered voters changed their minds in the last few days of the primary campaign. They virtually all went against Carter.

Pollsters, politicians and press alike did not detect the magnitude of such an extraordinary last-minute defection from the president. What gave the switch even more power and how quietly it was made. These were choices arrived at individually and obviously unswayed by a surge of sudden emotion over a new issue or event.

It was not like 1968 when you could palpably sense the emotion of the voters eager to register a protest over the war in Vietnam. No sense of a crusade swept New York and Connecticut, thus collectively helping force a different decision than anticipated.

Nor was it only one issue -- the voting behavior of Jews, for instance, over Carter's handling of Middle East policy -- that was decisive. Kennedy carried urban and rural areas of New York. And he handily carried state represents suburban America; it contains no town larger than 160,000 and its Jewish population much more resembles the national norm than New York's.

But whatever the dimensions -- and the composition -- of Kennedy's victory, the more intriguing questions involve the reasons for Carter's defeat and their implications for his political future.

The votes Tuesday came at a time when events, foreign and domestic, were combining to work against Carter. Economic news was dismal, the Iranian situation again unraveling and threatening greater woes ahead, and the voters faced what appeared final presidential choices of Carter vs. Ronald Reagan next fall.

Of all these factors, probably the most volatile concerned Iran.

Like John Kennedy with Cuba, for Jimmy Carter Iran has been the thread that has bound his administration. He ended his first year in office by toasting the shah and praising him lavishly in the opulent Royal Palace in Tehran. His second year concluded with the prospect of the shah being overthrown, raising new threats to Middle East stability and the president's policies in the crucial region. After his presidency had dropped to its lowest point in popularity and he faced a challenge from the dominant Democrat of the last decade, it was Iran that intruded at the end of his third year to affect his presidency.

In this case, it appeared to have rescued him from the political depths.

The pictures over our TV screens in recent days have brought home the issues about the shah and the hostages all over again. After almost five months of captivity, it now appears the hostages are as far from freedom as ever -- and new talk arises over their trial as spies.

Perhaps New York and Connecticut are aberrations, perhaps their votes do not mean the moratorium over Iran criticism has ended, and perhaps the public still will perceive Carter as the best choice for guiding the nation's economic and foreign course.

But for Carter, the crucial test lies ahead. He now enters the primary period of the other great industrial states -- Pennsylvania, Ohio, Michigan, New Jersey -- leading on to the most populous of all, California, in June. It's conceivable he can surmount political setbacks in them in the spring and still gain renomination, but certainly he will need them to win in the fall.