Why is the volume in this compress gas cylinder constant throughout?
It is about the volume of the cylinder, which of course does not change. You do not also consider the volume of the escaped nitrogen gas.