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
- A mathematician
- An astrologer (post-Aug.)
Also compare Wikipedia:Mathematics#Etymology.
As we read in another work of Kline himself:
[…] 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 Skeptics:SE fitting formula:
Exact science is good, superstitious practices not so much.
A recent comprehensive translation with annotations renders the passage in context as:
Eighteenth Title Sorcerers, Astrologers, and Others Like Them
[1] Emperor Antoninus Augustus, It is worse to kill someone with poison than with a sword.
Posted without day or year,
[2] Emperors Diocletian and Maximian August! and the Caesars to Tiberius. Learning and practicing the skill of surveyor (ars geomeiriae) shall be (deemed to be) in the public interest* But the despicable skill of astrology (ars mathematica) Is forbidden.
Written August 20, at Sirmium, in the consulship of the Caesars (294).
[3] Emperor Constantine Augustus to Maximus, pr. No diviner (haruspex), no priest, no one who customarily performs rituals of this kind shah cross the threshold of another, not even for another reason (than divination), but friendship with such persons, even when of long standing, shall be renounced. Any diviner who visits someone else’s house shall be burned alive, and that person who summons him through persuasion or material inducements shall be exiled to an island after his or her property is confiscated, i* We consider, however, the prosecutor of this offense not as an informer (delator) but as someone instead deserving of a reward.
Posted February 1, at Rome, in the consulship of Constantine Augustus, for the fifth time, and Licinius Caesar (319).
[4] The same Augustus and Licinius Caesar to Bassus, Praetorian Prefect. pr*
There shall be punishment and vengeance deservedly inflicted by the most severe laws upon the expertise of those who are discovered to be equipped with magic skills, to have meddled with people's health or to have turned chaste minds toward lust. 1. But criminal accusations shall not impede remedies devised for human bodies and nostrums, innocently applied in rural districts, to check concern for heavy downpours of rain falling upon grape-vintages ripe for harvest or their being damaged by the impact of falling hail By such means no one’s safety or reputation is harmed, but their actions bring it about that divine gifts and human efforts are not brought to naught.
Given May 23, at Aquileia, in the consulship of Crispus and Constantine Caesars (321).
[5] Emperor Constantius Augustus to the People. No one shall consult a diviner (hampex) or astrologer, nor shall anyone (consult) a soothsayer (hariolus). The depraved profession of augurs and seers shall fell silent, Chaldeans, magicians (magi), and the others, whom the common people call sorcerers (malefici) on account of the enormity of their misdeeds, shall not contrive anything of this sort. Everyone's interest in foretelling the future shall forever cease. For whoever refuses obedience to these commands will endure the death penalty (supplicium capitis), laid low by an avenging sword.
Given January 25, at Milan, in the consulship of Constantius Augustus, for the ninth time, and Julian Caesar, for the second time (357).
— Bruce W. Frier (ed): "The Codex of Justinian. A New Annotated Translation, with Parallel Latin and Greek Text", Volume 3, Cambridge University Press: Cambridge, New York, 2016. pp2335–2337.
Other StackExchange posts on Skeptics, History of Science and Mathematics, Latin and Math, related to this question and confirming the above, but offering different angles to look at the problem over time and languages used:
Did Augustine of Hippo warn Christians to beware mathematicians?
Question on "What St. Augustine didn't say about mathematicians"
When and why were mathematics and magic considered synonymous in England
Greek astronomy vs astrology
Did Galileo Galilei believe in astrology?
What was Copernicus trying to mean with 'Mathematics is Written for Mathematicians'?
Development of mathematics in Europe between 550-1050 A.D
Why does Aristotle write 'astrology' when Plato writes 'astronomy'?
Did ars mathematica mean mathematics in classical (and late) Latin?