Theories suggested for the blue hues
The colour blue is associated with Lord Shiva
Legend has it that the colour blue is associated with Lord Shiva, who during the time of Samudra Manthan (also, known as Churning of the Ocean Milk) gulped down vicious poison called Halahala, in order to save the planet. This venom turned his body blue, and since then, his followers consider it to be a sacred colour. Owing to its sacredness, many of his followers who were settled in the region daubed their houses in blue hues , thus the town received the moniker, Blue City.
Blue defines the Social Status
Yet another belief is that the blue colour is determinant of social status. This story goes back centuries when the Hindu caste system was considered to be the basis for determining the social status. According to the local lore, the Brahmin community (the priestly caste of India) painted their houses blue in order to differentiate themselves from the lower-caste communities, and since that time, blue is linked with the Brahmins. You might well hear these buildings referred to as Brahmin houses.
To keep termites away
There are those who believe that the blue colour help deter termites. According to this idea, termites damaged many historic structures and buildings in the city. So, in order to keep their property safe from these unwelcoming pests, the residents painted their houses with blue paint. This paint is a mixture of copper sulphate and limestone that not only wards off bugs, but also imparts a soothing and calming effect. The residents who advocate this theory strictly oppose the belief that blue is associated with the Brahmins. In their favour, they state that there are just as many families from other castes living in the blue-painted houses.
To keep the houses cool
Some locals believe that the colour blue is a good reflector of sun rays, so painting the house like this will keep their house cool in warmer months.
Speaking to locals will get you a host of new theories and reasons. Regardless of the truth, the blue landscape is aesthetically pleasing nonetheless.