There is a fairly acidic proton on vanillin. It has a pKa of 7.78, which is a measure of its acidity. As a comparison, water has a pKa of about 16. A smaller number for pKa means more acidic.
When you lower the pH you make it more basic and there is a deprotonation (acid base reaction) that changes the structure of vanillin.
Molecules with a large number of double bonds in a row tend to absorb visible light. The more double bonds you have in a row, the lower the wave length of absorption. A very over simplified explanation is that the deprotonation basically increases the number of double bonds you have in a row, lowering the wave length of light that is absorbed so that color can be seen.