Sometimes having a valid passport isn't enough. Your passport's expiry date may determine whether you can enter a country.
Some countries require a passports to be valid for as long as three months beyond your scheduled date of departure. If it isn't caught by your airline, you could end up being out thousands of dollars for a trip you never got to take.
The government of Canada keeps an extensive list of every country's passport expiry rules here: http://travel.gc.ca/.