I am frequently checked for passport when boarding the plane, not only at check-in. Not sure they check visas though.
And airlines letting people without valid documents travel are, when caught, required to fly these people back at their cost + probably fined. So yes, they are entitled to deny boarding for this reason.