In order to make a lot of money on a textbook, you have to be a fairly famous scholar to begin with. Mankiw and Spence were well known in their fields long before they “wrote” – i.e., put their names on, and maybe even directed the writing of – textbooks. Untenured faculty don’t get a lot of interest from textbook publishers, unless they are working in a field that’s red hot with no decent product available.
For a couple of years many decades ago, I was a research assistant to a famous professor who was the author of the most successful textbook in his field. He published a supplement every year – that was my summer job one summer, along with two other research assistants – and a new edition every 5 years or so. He had inherited the textbook from a mentor, and he passed it on to colleagues when he retired. It made him a fair amount of money – nothing remotely close to $40 million, but it was probably more than his actual salary at the time. The textbook certainly enhanced his prestige as a leading figure in his field, but he had the text because he was a leading figure in the field, not the other way around.
There was actually quite a bit of creative work and thought involved in the text. Working on the damn thing gave me a lot of respect for textbooks and their authors, at least good ones. Edition to edition, the changes were fairly modest, but if you looked back 20 years the books were very different. There was real art to giving fair consideration to all sides of various controversies in the field while making a subtle, nearly invisible case for the author’s preference, without giving anyone who disagreed with him reason to change texts.