OnceFirstly you need to be absolutely sure what the company policy on this matter is and follow it. If it is not clear, you should inquire about clarifying it with management.
Absent of policy or any clarifications, I would say that once you are in the company's area/campus past the first security check you are at work.
Look at it this way: it's not your fault that they have a security policy that takes you an extra-long time to get into the office. The time you spend at a security gate or in traffic is not your personal time, it is a direct consequence of their decisions and therefore it is 'how they chose to use you'.
They could always hire more security guards, build more security terminals, spend money to buy ridiculously expensive devices to scan cars, bags and people quickly.
It's ultimately a question of how they chose to run shop.