Spray cans work by containing a propellant which has a boiling point a small amount below room temperature. When the can is sealed the liquid and vapour reach equilibrium at a relatively modest pressure. When the spray valve is opened this pressure forces out the contents as an aerosol and more of the propellant evaporates as the internal pressure drops.
This has two advantages firstly the can doesn't need to be anywhere near as strong as if the propellant was a fully pressurised gas and it provides a fairly constant pressure untill the propellant is exhausted without needing mechanical regulators which would add cost and complexity.
This is pretty much the same principal as a butane lighter.
So what you need in a propellant is something with a very specific boiling point which provides the required vapour pressure at the expected operating temperature.
As mentioned in the comments butane and/or propane are now often used as propellants in aerosol type cans indeed 'canned air' dusters used for cleaning computers etc is often just butane.
One downside of butane is that there is an inherent cooling effect as the liquid evaporates and the gas expends which can cause a significant cooling effect and, as the boiling point of butane is a bit on the low side this can cause significant cooling of the contents of the can and a consequent drop-off in pressure.