Avogadro's law only holds perfectly for ideal gases (and holds well for non-ideal gases at high temperatures and low pressure). The reason being that the law fails in the presence of intermolecular attractions as these can change the volume of a given gas so that it deviates from that of a gas of weaker intermolecular attractions at a given temperature and pressure. For example, suppose you have a mole of helium gas at say, 1010C and at 1 atm of pressure. The intermolecular attractions are very weak in Helium and it would occupy a certain volume. Now compare this to a mole of water as a gas at this same temperature and pressure. Avogadro's law would predict that since both gases are at the same temperature and pressure and both contain one mole of substance that they should have the same volume (as in V=nRT/P).
In reality, the water would occupy a smaller volume than the helium. Why? Because the intermolecular attractions between water molecules are stronger than those of helium. Each water molecule would pull those other water molecules around it towards itself to some extent to make the distance between molecules less than it would be in the ideal case. These interactions would tend to compress the gaseous water somewhat so that it's volume is smaller than that of helium when we measure it. If we changed the conditions we could make this difference less and less (by raising the temperature and lowering the pressure so that, in both the water and the helium, the distance between species is so great that intermolecular attractions play a minor role), but Avogadro's Law would still only hold perfectly in the ideal case regardless.