During the Middle Ages, monks had a special status and with it came various privileges. For all the poor people who were struggling for survival (or those who were simply looking for a means of education), monasticism may have indeed been a good option to escape their dreary lives and to be presented not only with meals (and often when lucky even beer) but also with respect and impunity.
Because the monks were said to be doing God's work on earth, people both admired and feared them. In addition, their knowledge of the scriptures or their ability to read opened the gateway to knowledge usually hidden and inaccessible to the common masses. Since they were important in society, they also enjoyed various other privileges. For instance, should they have committed a crime, they were spared from the regular courts - where torture and hanging were the norm - and were tried in the much more lenient “monk-favorable” ecclesiastical court, a process generally known as the benefit of the clergy.
How did the judges find out who was a monk? Could one simply confide in the monk's clothing? In fact, there were many frauds and thieves out there who might have used the monk's garments to escape harsh punishment.
As a matter of fact, anybody who could read was often spared from the common courts; it was simply assumed that they were monks. This procedure can be seen as an early form of literacy test; however, one's life often hung on it. The accused were given a passage of the Bible which they were told to read; should they accomplish it, it was often equated with a pardon.
It turned out that the particular Psalm 51 was later nicknamed the “neck verse” because it had the power to save the “neck” of many a felon. Many of them had simply memorized it to impress the judges and to gain their liberty.
Nonetheless, if the judges had doubts, they could ask the accused to read other passages as well. If they did not know how to read, they would be exposed and sentenced to death. Those who could read may have simply gotten away with a penance.
Anyway, two things can be concluded from all of this. One, monks, as said before, were immune and could commit various acts with little or no consequence. Two, if you were a "gangster" in the Middle Ages, you had better brush up on your reading skills, and you could get away with pretty much anything, including bloody murder!