Lewd started as a church word for ordinary people. In the 1100s and 1200s, a lewd man was simply a layman, someone who was not a cleric.
The Old English form was lǣwede, "lay" or "of the laity." Merriam-Webster glosses it as "laical, ignorant," and those two senses are the whole story in miniature. In medieval England the clergy were the people who could read, especially Latin. So anyone outside the clergy was, by default, assumed to be unlettered.
The Middle English Dictionary shows the early range. The Peterborough Chronicle, in an entry from before 1121, pairs læred & lawed: the learned and the lay. That pairing became a stock phrase, and later poems speak of lewed and lered to mean everyone, high and low. A thirteenth-century religious rule calls lay brothers leawede breþren. A Chester record from 1287 even lists a man named William Lewede. A fifteenth-century book on hawking repeats the proverb "Lere or be lewde": learn, or stay ignorant.
Once lewd meant "not educated," it began to slide. By the 1380s the translator Trevisa used it for foolish minds, foolish beliefs and coarse, uncouth tales. The poem Piers Plowman calls something "as lewed as a Laumpe," useless. In the same decades the word also took on the meanings evil, wicked and unchaste.
That last sense won. Modern dictionaries define lewd as obscene, vulgar or sexually licentious, and "evil, wicked" is marked obsolete. The original meaning, lay or non-clerical, has vanished from everyday English.
A parallel word shows the same bias at work. Lay, from Greek laikos, "of the people," reached English through Old French lai. By the early 1300s it too could mean "uneducated, non-professional." The medieval habit of treating laypeople as ignorant shaped both words. Lewd simply went much further downhill.