In a nutshell: it's an irregular and obscure form that is used in place of the traditional forms. For a long time grammarians objected to negative contractions in general, and ain't seems to have borne the brunt of the criticism because it bears the least resemblance to the full form and because it's used for several different forms of to be.
Add to that the fact that it's also used for forms of to have, and it's easy to see how it attracted the negative attention of grammarians who felt it to be ungrammatical and vulgar. If someone uses an odd contraction to stand for half a dozen different things, all of which have more regular forms, then obviously it must be an atrocity against the language.