The point that he's a con man is that he signed a document with IBM to supply an OS when he had none. Of course in retrospect he was "smart" to go around and buy one, but in fact he was promising IBM something he didn't have and in an alternate universe he could be sued for that.
Based on the top links from a quick search, it seems IBM was fully aware that they were sub-licensing the OS through Microsoft:
https://www.pcmag.com/news/the-rise-of-dos-how-microsoft-got...
https://thisdayintechhistory.com/11/06/ibm-signs-a-deal-with...
From the second link:
However, Microsoft knew that a small company named Seattle Computer Products had developed an operating system similar to CP/M called QDOS, for Quick-and-Dirty Operating System. Microsoft suggested to IBM that QDOS could work as the IBM PC’s operating system. IBM asked Microsoft to license and further develop the operating system, which led to the formal contract on November 6, 1980. After the contract was signed, in December 1980 Microsoft would license the QDOS operating system to begin development of the IBM PC version.
If I order a new car, it may well not exist yet. The deal is that there will be a car on hand at some agreed upon date. I don’t think Gates did anything more illegal than the analogous car deal. More risky, perhaps, but that’s another thing entirely!