And how often was this the case? Were their ever legal restrictions in place, or societal or cultural stigmas to prevent it from happening more often? Or was it simply (or compounded by) a case of politics (knowledge is power)?
Well, the middle ages covers a really long time period. It's easier to speak to people of higher status than it is to know what was occurring among the peasantry.
Who needed to read? Priests, bishops, monks, abbots, abbesses needed to be able to read religious texts in order to be able to conduct religious services and do their job. Merchants needed to be able to create and read accounts, receipts. Lawyers, scientists, jurists, theologians, university teachers needed to be able to read. The average peasant didn't need to be able to read. To identify some symbols, words, phrases - yes. Reading wasn't a priority because (a) books were few in number, really expensive, in Latin and mostly about religion or history, (b) most jobs did not require it, (c) other people could read to them at mass, etc., (d) entertainment was performed at taverns, in the streets, etc. (eg. Beowulf). A literate population is predicated on a different infrastructure - one in which the majority of the population are no longer required in order to produce food and, in addition, a society which not only regards literacy as a good thing but which has the infrastructure to support and monitor education. Lots of paternalistic theories from year dot until now about perceived limitations of the smelly underclasses as well as more nefarious things. And yes, there are plenty of misogynistic misconceptions about the intellectual capacity of women.
As far as I know, and I'm happy to be corrected, I can't think of legal restrictions on education. The sumptuary laws of the later medieval period were a response to the inability to physically identify the status of an individual by their attire, etc. But literacy isn't something you can identify simply by looking at someone. Some kings were renowned for their emphasis on education as a means of improving the country and its population. The classic example is King Alfred who recruited some of the great clerical minds of his day, got them to teach him Latin, participated in his programme of copying, translating great works. He advocated primary education in English. Understandably, this was hailed as radical and amazing by his biographers, all of whom were educated!
I'm not aware of a reading outreach programme, as it were. A lot of basic education was done in the home and by women. This would be limited by the level of education reached by the mother herself. Even queens were heavily involved in the education of royal children. As the medieval period draws closer to the early modern, schools were more common in towns or cities. The teachers in the schools were more likely to have a religious background or training. And, of course, this had to be paid for, so excluded those from a poorer background.
Also worth remembering that members of enclosed orders, i.e. monks, priors, etc (basically most apart from the mendicant orders) were supposed to live apart from society. This was a big part of their mission statement and identity. They would educated children donated to the abbey as monks and help improve the skills of their fellow monks, but were never intended to go out into the general public and teach them to read.
The Reformation changes the rules of the game primarily by placing a new emphasis on developing your relationship with god by reading the Bible yourself. So, this took away the monopoly of the clergy as the intermediaries between God and the individual and also emphasised the new importance of translating the Bible into the vernacular. But, even then, literacy rates were very variable. The most effective use of the printing press during the early Reformation was in the production of satirical drawings with minimal text. However, the combination of these things created opportunity on a previously unknown scale - reading was more affordable and appealing.
Hope that helps. Big topic!