It used to be a decent contraction for "am not", however people started using it incorrectly in places where it didn't contract "am not", and it became stigmatized.
Why did people start using "ain't" incorrectly?
"Ain't" is a perfectly acceptable word in educated spoken English. It's not general purpose though. You have to use it in the right contexts, some of them bordering on fixed expressions.