The more blue you see in a medieval or Renaissance painting, the wealthier the patron who commissioned it. In fact, it became a status symbol. If you see a painting with a blue background, you’re basically looking at the medieval equivalent gold-plating your toilets and faucets. If you see blue in art from the Middle East, it doesn’t have the same connotations, because lapis is plentiful there.
The prestige associated with the color blue probably also contributed to why it’s typically associated with the Virgin Mary. She’s almost always shown wearing a blue dress or cloak.
I learned this fun fact and many others about paint and colors in Philip Ball’s Bright Earth: Art and the Invention of Color. It was also mentioned in Ingrid Rowland and Noah Charney’s The Collector of Lives: Giorgio Vasari and the Invention of Art. You can read about the book here.
Note (5/2/18): In case any of you were wondering, this fact doesn’t apply to stained glass. The process of making colored class is totally different than that of making pigment. Cobalt, not lapis lazuli, is used to make the blue. Therefore, you may notice that blue is very prominent in medieval stained glass. Red was the expensive color there.