Most countries have a general rule that passports must be valid for at least six months beyond the planned visit. There are then lots of bilateral agreements in place to reciprocally waive those rules. Apparently the US has one of these agreements with Hong Kong and Macao (presumably pre-handover) but not with the Chinese mainland.