You need to direct both stderr and stdout into the file:
nc -vv -z localhost 1-80 > file.txt 2>&1
Running the command against just one port (80) didn't generate any messages to stderr, so writing stdout to the file was sufficient to capture everything. However, with a range of ports (1-80) we definitely get output written to stderr, so we need to capture that in addition to the redirect that captures stdout.