What you are seeing is stress in the window resulting in birefringence: the speed of propagation of polarized light depends on the direction of polarization.
In the setup you have, the light in the sky is partially polarized because that's how Rayleigh scattering works; this partially polarized light is transmitted through the window where it rotates (because of the birefringence) depending on the stress. The polarizer on your camera acts as the analyzer: some of the polarized light will be more at right angles while other light is more parallel to the axis of the second filter.
Now birefringence is a function of wavelength: so different colors will be rotated by different amounts, and will be more or less attenuated. And this is what gives rise to the colors.
Here is an example of an image of a plastic box with in built stresses viewed through crossed polarizers source:
UPDATE - why Rayleigh scattering leads to polarized light:
In this website we read:
The most common example of Rayleigh scattering is the scattering of visible radiation from the Sun by neutral atoms (mostly Nitrogen and Oxygen) in the upper atmosphere. The frequency of visible radiation is much less than the typical emission frequencies of a Nitrogen or Oxygen atom (which lie in the ultra-violet band), so it is certainly the case that $\omega \ll
\omega_0$. When the Sun is low in the sky, radiation from it has to traverse a comparatively long path through the atmosphere before reaching us. Under these circumstances, the scattering of direct solar light by neutral atoms in the atmosphere becomes noticeable
In Rayleigh scattering, the electrons around an atom are a driven simple harmonic oscillator: classically, you can think of it as a negative cloud that can move with respect to a positive center, and if you could displace it, it would vibrate around its equilibrium position with some frequency $\omega_0$. Now when you excite this cloud with a transverse electrical signal (EM wave like light) it will emit light mostly at right angles to the axis of excitation - in fact there's a $\left(\frac{\omega}{\omega_0}\right)^4\sin^2\theta$ term in the intensity distribution. This both tells us that the intensity of the scattered light drops quickly for longer wavelengths (the key is blue) and also that when the sun is to your right, the polarization of the sky will be in the up/down direction (perpendicular to the line from the sun to the point). This is explained in more detail at this website on polarization which is also the source of this animation that shows the direction of polarization that you expect:
The rainbow did not become brighter through the polarized sunglasses (PS). Rather, the PS enhanced the contrast between the rainbow and the background light of the sky: The PS decreased the brightness of the sky, while the effect on the rainbow, if any, was much smaller. While the eyes have adjusted to the absolute level of brightness, the relative brightness of the rainbow (i.e., contrast) became higher.
The reason why the colors appear more vibrant through the PS is the same: higher contrast.
And, just in case, the reason why PS enhance the contrast is described in detail in the section “Sky polarization and photography” of the Wikipedia article on polarization.
Best Answer
In the case of rain droplets, where the size of the drop is much larger than the wavelength of visible light, the effects you see can be described in terms of the familiar concepts of refraction, reflection and diffraction. The rainbow is generated by different colors being refracted at slightly different angles as they enter the drop, reflecting off the back of the drop and then being refracted again as they exit the drop (see this diagram). The reflection part of this is what leads to the polarization of the rainbow. When light transitions between two optically different mediums some of the light is transmitted and some is reflected, with the polarization component parallel to the surface being more strongly reflected (see this diagram). This leads to a preference for one polarization orientation for the light leaving the back of the drop and a preference for an orthogonal orientation for the light passing through the drop.
If you are wondering why there is a preferred polarization I would suggest you look into Fresnell's Eqautions but conceptually the idea is basically just that the polarization component parallel to the surface interacts the least with the medium.