It allowed the switching equipment to recognize the string of 3 numbers as an area code without help from a human switchboard operator. Trouble was, both area codes and exchanges were running out of numbers, so more flexibility was needed. It was a good plan and it worked well until sheer volume of telephone accounts overwhelmed it.
"At first, area codes were all in the form N-Y-X, where N is any number 2-9, Y is 0 or 1, and X is any number 1-9 (if Y is 0) or any number 2-9 (if Y is 1). The restriction on N saves 0 for calling the operator, and 1 for signaling a long-distance call. The restriction on the second digit, limiting it to 0 or 1, was designed to help telephone equipment recognize the difference between a three-digit "area code" (with 0 or 1 as the second digit) and the three-digit "exchange" prefix (which had avoided 0 or 1 for the second digit, because of restrictions in existing switching equipment). For example, when a caller dialed "202-555-1212", the switching equipment would recognize that "202" was an area code because of the middle 0, and route the call appropriately. If a caller were to dial 345-6789, the 4 would be recognized as a long-distance call within the area code and routed as such, without waiting to see or guessing at how many digits the caller meant to enter."
https://en.wikipedia.org/wiki/North_American_Numbering_Plan#History