No. They used a sentence that includes "mathematica" and condemns and forbids it, but they were not using a modern definition of "mathematician", which gives the sentence a very different interpretation.
A Latin Dictionary defines "mathematicus" as:
măthēmătĭcus […]
A. Măthēmătĭcus
1. A mathematician
2. An astrologer (post-Aug.)
Also compare Wikipedia:Mathematics#Etymology.
As we read in another work of Kline:
[…] astrologers were called mathematicii and astrology was condemned by the Roman emperors. The emperor Diocletian (AD 245–316) distinguished between geometry and mathematics. The former was to be learned and applied in the public service; but the "art of mathematics"—that is, astrology—was damnable and forbidden in its entirety.
The "code of mathematics and evil deeds;" the Roman law forbidding astrology, was also applied in Europe during the Middle Ages.
— Morris Kline: "Mathematical Thought From Ancient to Modern Times", Vol1, Oxford University Press: Oxford, New York, 1990. (p179 in 1972 edition, gBooks)
As can be seen in:
The most important provisions of the two codes are found in the title: De maleficis et mathematicis et ceteris similibus, "concerning magicians, astrologers, and all such like.
— Cod. Just. IX, 18: Cod Theod. IX, 16.
— via Clyde Pharr: "The Interdiction of Magic in Roman Law", Transactions and Proceedings of the American Philological Association, Vol. 63 (1932), pp. 269-295.
For a full Latin version, go here:
Wikisource: XVI de maleficis et mathematicis et ceteris similibus
For a close translation of the question title:
CJ 9.18.2 (AD 294)
Artem geometriae discere atque exerceri publice
intersit. Ars autem mathematica damnabilis interdicta est.
A more appropriate and well known translation of this snippet reads:
Concerning Poisoners, Diviners, and Other Criminals of the same Description
It is a matter of public interest to learn and practice the science of geometry, but the art of divination is damnable, and is strictly prohibited.
While artem is translated above as 'science' and 'art', it could also be translated as 'fraud' (trick, wile). So to better capture the spirit of this juxtaposition, one might even phrase it as
To learn and practice the science of geometry is in the public interest.
But the damnable fraud of astrology is forbidden.
If the subfield of geometria is then seen as pars pro toto for mathematics, then we have a very SkepticsSE fitting formula:
Exact science is good, superstitious practices not so much.