Why do you think air becomes thinner higher up?
Dear Student,
Air is a matter and is attracted towards earth due to gravity. This is the reason air density is more at earth's surface but decreases as we go up and hence air becomes thinner as we go at higher altitudes.