US and Canadian telephone numbers didn't start out as seven digits. Up until the 60s, they were five-digit numbers preceded by two letters to indicate their location. When calls were connected by operator, you would say that you wanted "Edgewood 5-5555", where "Edgewood" is the name of the telephone exchange where the other party was located. When the process became automated and you could simply direct dial, telephone keypads were printed with numbers. "Edgewood 5-5555" became the seven-digit number of today: ED 5-5555 is now 235-5555. Area codes for long-distance dialing and country codes for international dialing were layered on top of that.
While the number of phone numbers, in retrospect, can be seen as an explosion, the increase was gradual. Phone companies knew that people were getting more phone numbers, but didn't necessarily know what they were used for. You didn't call the phone company and say "I need a fax line", you called and said "I need a telephone line".
US and Canadian telephone exchanges are hard-wired to expect a telephone number of one of the following forms:
- three digits: originally reserved for emergency services (911), later expanded to additional services like information (411)
- seven digits, not starting with a 0 or 1: local calling (not accepted by some local exchanges, such as Atlanta; in those locations, all local calls must be dialed as ten digits)
- ten digits, not starting with a 0 or 1: local calling with area code
- eleven digits, starting with a 1: long-distance calling
- unknown digits, starting with a 0 or 00: international dialing
(If you want to know more about how the US and Canadian telephone numbering system came about, and the other limitations on telephone numbers that I didn't list here, Wikipedia's article about the North American Numbering Plan is a pretty good place to start.)
Fax machines weren't necessarily getting dedicated phone numbers when they were added. Early on in their adoption, they were part-time machines, and you would have to call and say, "I need to fax you, will you turn your machine on?" Then both parties would have to hope that the next caller was the fax machine. This applies to other technology using telephone lines in that same time period, such as modems. It's not fax machines or modems that caused the explosion in telephone numbers. It was the pager and the mobile phone. Businesses were the ones most likely to have multiple numbers, and they're the ones also most likely to have a fax machine. One more telephone number for a business didn't cause the existing system to buckle. It was when individuals had multiple telephone numbers that the limitations in the system became an issue.
Adding a digit would have been difficult since it would require a change in the expected format of telephone numbers, which would be handled at the telephone exchange. This is a significant undertaking. Even just turning off seven-digit numbers, as has been done in some metropolitan areas like Atlanta, required significant engineering time. It was much easier to add area codes to cities, which had a much lower engineering cost. The benefits of adding a new telephone number format weren't viewed as all that significant. The problem that you outlined of having a fax machine calling a human in the middle of the night wasn't widespread enough to be a problem that needed such an expensive solution. Telephone number portability isn't related to this issue, as it was only introduced in the early 2000s, long after mobile phones were all but ubiquitous.
A different solution would have been to allocate specific area codes to mobile phones. This could have been done to fax machines too, and as the fax machine has fallen out of use, those area codes could have been reclaimed and reassigned to another usage. This is actually what happened with telex. The phone companies didn't foresee the explosion of mobile phones; by the time that they did, it was too late to enact such a change.
Internationally, a solution like this is how the problem was solved. For example, in Australia, all mobile numbers have the 04 prefix, and 05 is reserved for mobile numbers when 04 runs out. Landlines have a similar prefix, based on their physical location. Telephone numbers in China have gone a step further, and you can tell exactly which mobile operator the receiver is using, as well as the technology (GSM, CDMA) in use, based on their telephone number.
This allows for a major difference in how telephone numbers are used and billed overseas. In the US, when you dial a mobile phone, both the caller and the receiver pay for the call, since incoming calls are counted against the receiver's available allotment of minutes. Overseas, a caller knows that they are calling a mobile number, and they pay an increased charge to dial a mobile number.
This was probably a lot longer of an answer than you might have guessed. There's a lot of history in this answer, dating all the way back to the beginning of the telephone network when human operators connected calls.