There is an Ideal Gas Law, but why isn't there one for liquids or solids? Is it because they are much too hard to predict or that solids and liquids vary drastically in their reaction to temperature and pressure then do gases, thereby nullifying the need for a Law that could apply to all?
States of Matter – Is There an Ideal Liquid Law or Solid Law?
ideal-gasmatterstates-of-matter
Related Solutions
In the limit of very high temperature, all gases become ideal (assuming they don't ionise, dissociate, etc), but this regime is far above the Boyle temperature. Around the Boyle temperature the long range attractive forces are still significant and cause non-ideal behaviour. It's just that there is a sweet spot where the attractive forces are balanced by the molecular volume.
With real gases there are two effects. At short range, there is a repulsion, and at long range, there is an attraction. A common model for this is the Van der Waals equation. You're probably familiar with the ideal gas law:
$$ PV = nRT $$
The Van der Waals equation modifies this to be:
$$ \left(P + \frac{n^2a}{V^2}\right) (V - nb) = nRT $$
where $a$ and $b$ are constants. $a$ is a measure of the long range attraction and $b$ is a measure of the short range repulsion. The Boyle temperature is the temperature at which the attraction and repulsion balance out and the gas behaves approximately ideally. Below this temperature the short range repulsion dominates over the long range attraction, while above this temperature the long range attraction dominates over the short range repulsion.
The derivation of the Boyle temperature is straightforward and easily Googlable. I'll sketch it here. For an ideal gas we can rearrange the ideal gas law to get:
$$\frac{P}{RT} = \frac{n}{V} = \rho $$
where $\rho$ is the molar density $n/V$. For a non-ideal gas we can use a similar expression:
$$\frac{P}{RT} = \rho + B_2(T)\rho^2 + B_3(T)\rho^3 + ... $$
where $B_2$, $B_3$, etc are the second, third, etc virial coefficients and are functions of temperature. For most gases we expect $B_2$ to be much smaller than one, $B_3$ to be much smaller than $B_2$, and so on so they are small corrections.
Anyhow, the Boyle temperature is the temperature at which $B_2$ is zero so the expression most closely matches the ideal gas law. So we just need to write the VdW equation in this form and we can calculate $B_2$ as a function of $a$, $b$ and $T$. To do this we rerrange the VdW equation to get:
$$\begin{align} P &= \frac{nRT}{V-b} - \frac{n^2a}{V^2} \\ &= \rho RT \frac{1}{1-\rho b} - \rho^2 a \end{align}$$
Then we assume that $\rho b$ is much less than one, so we can use a binomial expansion:
$$ \frac{1}{1-\rho b} = 1 + \rho b + (\rho b)^2 + ... $$
Substitiuting this in the equation above and neglecting terms with a factor of $\rho^3$ or higher gives:
$$ \frac{P}{RT} = \rho + \rho^2 \left(b - \frac{a}{RT} \right) $$
The Boyle temperature, $T_B$, is the temperature at which the $\rho^2$ term becomes zero so:
$$ b - \frac{a}{RT_B} = 0 $$
or:
$$ T_B = \frac{a}{bR} $$
When you compress a gas into a deodorant can it does indeed heat up. Then if you let the can cool the pressure falls again. The pressure and temperature will remain related by (approximately) the ideal gas law:
$$ P = \frac{nR}{V}\,T $$
You say in your question:
It seems like the gas equation doesn't apply when the gas is cooling down within the can and the pressure remains the same. (my emphasis)
But the pressure doesn't remain the same while the can is cooling.
For completeness we should note that in real deodorant cans the gas used liquifies under pressure so the behaviour is more complicated than a simple ideal gas.
Best Answer
In gases, under normal conditions, the average distance between molecules is large compared to size of the molecules so the molecules spend most of their time far apart. Interactions between molecules, or at least strong interactions between molecules, tend to be short range. This means that interactions between molecules don't have much effect on the overall properties of the gas because the molecules spend most of the time too far apart to interact strongly with each other. This means that to a good approximation we can ignore interactions between molecules completely, and this is what we mean by an ideal gas. An ideal gas is one where the gas particle do not interact.
So we don't have to worry whether the gas is made up from helium, or oxygen, or chlorine or whatever. As long as the molecules spend most of their time far apart the gas will behave as an ideal gas so all gases behave pretty much the same way. All we need to do is correct for the mass of the gas molecules, which is a straightforward numerical factor.
The trouble is that in liquids and solids the molecules are very close together. In fact in solids they are touching and in liquids they aren't far off that. Because the molecules are so close the interactions between them are strong, and therefore can't be ignored. That's why, for example, solid iron is very different to solid paraffin wax. Since we can't ignore interactions in liquids and solids there can be no universal ideal liquid or ideal solid equations that all liquids and solids obey.