Specifically with regards to how 'vulgar' relates to language, a key commonality between the old meaning and the new is the notion of a standard.
Before the spread of the printed word, Latin was the lingua franca for the high-born and educated in Europe. As the scholarly, administrative, and clerical language across the continent, Latin was the standard language for communication deemed of any value or importance. Other languages, often regional and without much written form to speak of, were known as vulgar languages (lingua vulgaris), and these would be the languages of the common people. In fact, many of these languages would become the Romance languages of today, but as non-standard variants of the highest form of written Latin, were known at earlier points as Vulgar Latin.
You can see in this way how the meaning of vulgar language today might relate to this notion of language that isn't fit for high, proper forms of communication. Adding the class and moral dimensions that many people have already mentioned, you can understand how the meaning became more severe and derogatory over time.
A similar transition can be seen with the words 'profane' and 'profanity.' Profanum, their root, originally denoted the normal, natural and mundane aspects of the world to be contrasted with Sacrum, the sacred aspect related to world of religion. Today, though, 'profanity' means something much more negative.