Because airport security needs to make sure that you are not carrying any weapons, explosives, or other dangerous items in your laptop that could compromise passenger safety or disrupt the airport environment. By scanning the laptop outside of the bag, they can detect certain items more easily and accurately.