If the door closed at flight time then the plane wouldn't be leaving at flight time, it would be leaving at flight time + the time it takes to go from boarding to getting in the air. Flight time is the time the plane is scheduled to take off, which means the flight time would diverge from the boarding time, and then you'd once again be asking why the boarding time is different from the flight time and why they don't let you board until the flight time, rinse and repeat.