The office that issues the e-gate cards is located in departures, so you have to enter Qatar before you can get one.