Travelling on an out-of-date passport is usually illegal, and always a bureaucratic nightmare…
So the 6 month time limit is to make sure that your passport will still be valid for your return trip.
Most countries won’t let you in if your passport is about to expire. They want you to leave, ya know.
If an airline carries a passenger to a destination where he is not allowed to enter due to invalid paperwork, the airline has to pay the expense of carrying that person back to where he came from.
Think about how pissed off the airline would be if they had to give a free ride to a non-paying passenger and his two suitcases.