The whole flight does not need to be cancelled. Underselling flights are often replaced with smaller aircraft. One person might not make a difference, but if 10 or 20 cancel, an A321 may get replaced by A320 or A319, which are lighter and burn less fuel.
Switching to a smaller aircraft isn't necessarily good for the environment.
For example the A319 burns 5%/less fuel than the A320 but has 15% fewer seats, in common configuration. So the per-seat emissions are worse than if they had sold the remaining A320 seats at cost