Actually, the primaries were a way of reforming the older system, where the convention delegates were chosen by party leaders, and the leaders controlled their delegation.
Primaries were set up so the delegates would be chosen by the people in open elections. By 1972, the Democrats pretty much eliminated convention delegates being picked by the leaders (there were and still are a few, but a very large majority of the delegates are chosen by primary).
Caucuses came later; the New Hampshire law gave that state a big influence on elections (as did the half-truth that no president was ever elected without winning the NH primary*). The system also ensured that the primary would determine the candidate, not the convention. In addition, candidates were often judged not on their performance in the primary, but how much better or worse their performance was than the pundits predicted: if the pundits were wrong, it was the candidate who would suffer (or get a boost).
Iowa started the caucuses partly to gain some primacy over New Hampshire. They were aware of the law that made NY the first in the nation, and started having caucuses a week or two before. The caucuses were not to pick a candidate, but rather were straw polls to show what the voters wanted. They meant very little until Jimmy Carter won one, and the press started boosting his candidacy (since they had been wrong on the pessimistic side).
I think most politicians agree the current system is a mess: they require too much campaiging and money in states that are relatively small. It’s also a crapshoot: Howard Dean went from phenomenon to joke in ten seconds (and since the pundits were wrong about him and he worse than they predicted, he suffered). Not that he would have been a great candidate, but it’s utterly absurd that a candidate becomes discredited over such trivia.
There’s also no reason to believe the current system gets better candidates than the old ones. In the old days, the political bosses were acutely aware of what their constituents wanted (how else to manipulate them?), and would get behind the best candidate even if he wasn’t exactly what they wanted. Nowadays, the parties are held hostage by those who vote in primaries – a small segment of the party, and one which is more extreme than the general party voter (more liberal than most Democrats; more conservative than most Republicans).
*It was true, but the winner sometimes didn’t even get his party’s nomination: Henry Cabot Lodge and Lyndon Johnson (who did defeat Eugene McCarthy, despite the myth), for instance.