It's because nitrogen is the gas which causes inflation of the airbag, and in the equation there is a 2:3 molar ratio of NaN3 to N2. So when you use the ideal gas equation you are getting the moles of nitrogen and you need to multiple by 2/3 to get the moles of NaN3 that you need