This urban legend is false. According to The Prize's Rite and the peer-reviewed "Why is there no Nobel prize in Mathematics" he was never married and there is no written record of his motives except of his last will:
..the interest on which shall be annually distributed in the form of prizes to those who, during the preceding year, shall have conferred the greatest benefit to mankind. The said interest shall be divided into five equal parts, which shall be apportioned as follows: one part to the person who shall have made the most important discovery or invention within the field of physics; one part to the person who shall have made the most important chemical discovery or improvement; one part to the person who shall have made the most important discovery within the domain of physiology or medicine; one part to the person who shall have produced in the field of literature the most outstanding work in an ideal direction; and one part to the person who shall have done the most or the best work for fraternity between nations, for the abolition or reduction of standing armies and for the holding and promotion of peace congresses.
It is in the Nobel committee to fulfill his will of inventions and discoveries, that have been proven to be useful for the benefit to mankind. E.g. there was never a prize awarded for a new physical theory alone, just for a proven theory with an application. Einstein never got the prize for the special or general theory of relativity, he got it for the theory of photoelectric effect, that was measured and verified in an experiment and proven to be usefull in generating electricity.
There was actually a mathematician once awarded a Nobel prize 1994, John Nash, for his achivements in game theory. However, the commonly known Nobel prize in economics is the "Nobel Memorial Prize in Economic Sciences, established in 1968 and endowed by Sweden's central bank".
There are also several noteworthy prizes in the field of mathematics:
Abel Prize, Fields Medal, Chern Medal should be mentioned. Their combined prize money is even higher than the Nobel prize.
Ironically, if Mittag-Leffler was ever in dispute with Alfred Nobel, in the first
few years after Nobel’s death in 1896, he was of
“decisive importance...in
shaping the decisions and hence the international standing of
the [Nobel] prizes” [p. 8, Crawford,The Beginnings of the Nobel Institution, Cambridge University Press, 1984]