My guess is that it is something to do with the difference in boiling point between the two aforementioned molecules. But I can seem to come up with a logical explanation to why this is the case.
Well, an ideal gas has no attraction force between its molecules and does not have a boiling point, as you cannot make it liquid. Also, the sum of molecule own volumes is supposed negligible wrt the gas volume.
Water does not form anything close to an ideal gas because of its hydrogen bonds. You have to heat water to 100 °C to make it boiling to overcome these bonds between molecules of liquid water. Molecules of water vapour interacts with each other as well, especially at high pressure.
If water had not had these bonds, it would have reportedly boiled at -120 °C. And if water had not been polar, what makes intermolecular attraction as well, its boiling point would have been comparable with nitrogen.
Nitrogen is a non polar gas, with minimal molecular attraction, compared to water, due weak van Der Waals force, which leads to nitrogen boiling at -196 °C.
For deriving ideal gas law we assume that there exist no intermolecular forces between molecules and their size are negligible.As the size or intermolecular interactions increase there would be a increase in deviation from ideal gas law.Obviously here interactions is the major factor.(H-bonding in water)