Because, as was mentioned earlier, pilots have to open the door in order to go to the bathroom. As I understand it, the pilot has to first notify a flight attendant. The attendant will then position a drink cart in the aisle to block any passengers from coming forward. Then the pilot can leave and go into the bathroom. Presumably a second door will take the place of the drink cart (which is on wheels and easily pushed out of the way).