As mentioned above, you are confusing large-scale dynamic (non-equilibrium) systems with stationary gas locally in mechanical equilibrium. At any local point in free, stationary air, the earth's atmosphere obeys the ideal gas law, p = ρRT/m, and pressure varies only with elevation, where pressure, p, decreases as density, ρ, and generally temperature, T, decrease with elevation.
That has to be the case because if two adjacent, small volumes of gas (for example inside and outside the aircraft) were at different pressures then there would be a net force across the interface, and the higher pressure volume would expand, compressing the lower pressure volume, until their pressures were equal (mechanical equilibrium).