when the ink is filled inside the pen at normal sea level,
it is filled at a certain atmospheric pressure.
when we go to a higher altitude
the pressure increases
the air column exerts a pressure on the ink in the tube of the pen,
as a result of which the ink is pushed upwards.
The pressure of atmosphere becomes so extreme at a point that the pen ink starts leaking