Guess it's time to debunk some conspiracy theories about Jesus.
(My credentials: I have a Masters of Divinity, which is a combination of Biblical analysis, Christian history, and some other odds and ends. I am not Catholic, and have never attended a Catholic school; my school taught using the standard academic texts about the Bible, not doctrinal assertions from any denomination or Christian group. Although my professors were all Christian, the Biblical and Christian history was taught the same way it would have been if an atheist were teaching it.)
There is absolutely ZERO evidence that Mary Magdalene was a sex worker. The belief that she was is based on a combination of Medieval misogyny (on several levels) and sex negativity. As for Jesus, the only evidence that Jesus was married comes from one fragment of a papyrus with shaky provenance that was probably written at least 200 years after Jesus' death (and probably later than that).
"But that's because the Catholic church suppressed everything!" Well, if you knew anything about the early church, you would realize that's nonsense on several levels. The Catholic church as we know it didn't exist yet. Until Christianity became intrinsically linked to the power structures of the Roman Empire in the 4th Century AD, authority was decentralized. Local areas governed themselves. They had bishops, but there was no central authority appointing them, it was "whichever priest or monk the locals think is especially holy and/or wise". There was no central set of scriptures that everyone agreed to, the central set of doctrines was still under hot debate, as were organizational structures and worship patterns and pretty much everything else. The Catholic church has historically done a lot of censorship and suppression of things it didn't like, but that begins in the Medieval era, when it had the power to enforce things, which it did NOT in the early centuries of Christianity.
Early Christians decided things like "which books should be in the Bible" with a series of ecumenical councils between 325AD and 787AD where hundreds of representatives from all around the Mediterranean and beyond came together and decided on things they could all agree on. When texts were not included in the New Testament, it was because only a handful of churches actually used that text. Not because a central authority told them to, because there wasn't a central authority. But because they didn't like it, or they knew that (despite it claiming to be from the first apostles) it was actually written much later.
We know a great deal about what texts the various early churches used because we've spent a LOT of archaeological time and effort over the last century excavating 1st and 2nd century Christian areas looking for texts. And then scholars worldwide spend years analyzing them to death. (Many of them are not Christian.) (Any translation of the New Testament made in the 20th Century is based on those archaeological manuscripts, not the ones sitting in the Vatican, btw.) We also have a bunch of letters from early church leaders where they discuss all of this. We know with a fair degree of certainty which texts (and which versions of texts) were earlier and which were later. In order for all of that to be wrong, somebody centuries later would have had to come in, dig up all of the archaeology, destroy some of what was there, and put it back so neatly that modern archaeologists can't tell things have been changed.
"But what if those early Christians were sex-negative misogynists who didn't want to record Jesus' marriage?" Christianity's hatred of sex didn't get codified until the writings of St. Augustine in the 3rd-4th Centuries; the early Christians would have had no reason to suppress that Jesus was married, and we have a lot of copies of the New Testament texts that date to the first and second centuries. Besides the Gospels itself, Paul spends a decent amount of time talking about marriage and families in his letters, and he never once even implies that Jesus might have been married.
Also the Catholic church is European. The great Christian power in the Levant, Turkey, Greece, and other areas that had large concentrations of Christians in the first few centuries of Christianity was the Orthodox church. So if there was anybody creating a conspiracy and altering things it would have been the Patriarch of Constantinople doing it, not the Pope in Rome.
In Christian communities, sharing stories, myths, and legends about Jesus was a cottage industry. Everybody was making up and sharing stories. Most of them don't seem to be designed to be taken as factual. The Gospels that made it into the Bible were the earliest ones, the ones that everybody knew dated back to the first generation of Jesus' followers. Those, they were careful about keeping accurate and copying precisely and upholding their authority. The other stories that got passed around were held to different standards--and that's why they weren't included in the Bible. Most of them seem to be designed assert what Jesus would have said or done in such-and-such situation, or in response to a particular topical issue, or just make Jesus seem like The Most Awesome Dude Ever. (It was sort of like fanfic. "wouldn't it be cool if Blorbo From My Religion had said/done X?" and it continued to be a major thing up through the late medieval period.)
So, with that background, where does the idea that Jesus was married come from? Mostly, it comes from The DaVinci Code. I mean, periodically people have thought "wow, wouldn't it be cool if Jesus were married?" but with no evidence or source beyond "wouldn't it be cool." Which also is the sum total of Dan Brown's evidence. People who believe it point to a single fragment of papyrus, written in Coptic. And that fragment is not believed to be a forgery but it doesn't have any provenance and there's a lot of mystery surrounding where it was found. And only a small handful of scholars have been allowed to inspect it. So like. It's shaky, at best. (Also, it wasn't publicized until 2012, and so cannot be the source of earlier stories.) We don't start seeing Christian texts in Coptic (an Egyptian dialect) until the beginning of the third century AD. So the very earliest this papyrus fragment could come from is about 170 years after Jesus' death, in a text written in a language Jesus didn't speak, in an area he never lived in. In a time where people were passing around all sorts of legends. Assuming that it is a genuine ancient text, it's still not very good evidence that it's relating historical sayings of the actual Jesus. The Bible mentions Jesus' parents and siblings, why doesn't it mention a wife anywhere?
Dan Brown made a shitton of stuff up for The DaVinci Code and its sequels. It is a great work of fiction, but it is fiction. The thing he's really good at is coming up with puzzles that tie into things people want to believe, and into various historical conspiracy theories. Please take everything he says with a boulder of salt.
So now let's turn to the question of "was Mary Magdalen a sex worker!" And the answer is no, she was not. You have to understand that there are a lot of women named Mary in the Bible, and lots of people conflate them. For our purposes, the other Mary you need to know is Mary of Bethany (sister of Martha and Lazarus).
In the Gospel of John, Jesus raises Lazarus from the dead. In the next chapter, Mary of Bethany (Lazarus' sister) anoints Jesus feet with oil, presumably in gratitude for her brother's resurrection.
In the other three Gospels (Matthew, Mark, and Luke), there is also a story about a woman anointing Jesus' feet, but she is unnamed and pretty clearly not Mary of Bethany. She is a sinner who washes Jesus' feet in gratitude for having been forgiven. The context of the story--and the way Jesus talks about it--are completely different. But historically, people would go "eh, all women are the same, right? so this unnamed woman has to be Mary of Bethany" despite all the differences in the text and context.
So then we come to Mary Magdalen. Mary, we are told, had seven demons cast out from her and after that became one of several wealthy women who paid for his and the disciples' bills (this is a patronage relationship, and doesn't imply anything sexual--wealthy people in those days would regularly subsidize teachers they liked. Lydia, for example, supported Paul in his ministry, as did several other women he names in his letters.)
But the medieval Catholic church looked at this and went, "well, all women are basically the same woman, right? Mary Magdalen and Mary of Bethany and all the other Marys (except Jesus' mom) are all the same woman, pretty much. So therefore, Mary Magdalen anointed Jesus' feet, and therefore she was publicly known as a sinner. (Despite the fact that a) Mary Magdalen didn't anoint Jesus' feet, and b) Mary of Bethany, who did, wasn't publicly labelled a "sinner") And also, look at those seven demons that were cast out from her, that's GOT to be a reference to the Seven Deadly Sins, right? (which were a medieval fabrication, not found in the Bible.) And the sin of women is lust, so therefore Mary Magdalen was controlled by lust and therefore she was a prostitute!
And in addition to the fact that there is zero evidence of this whatsoever, there's the fact that the vast majority of sex workers in the ancient world were desperately poor. She would not have had the money to sponsor Jesus and his disciples if she was a former sex worker.
As someone who believes that sex work is work and should be legalized (and that sex workers should be unionized and have legal protections), I'm not saying this because I think her being a sex worker would be a shameful thing. I really like all the modern theology about "Jesus hanging out with sex workers." I wish it were true! But it almost certainly isn't.
tl;dr: Jesus almost certainly wasn't married, Mary Magdalen was never a sex worker, and Dan Brown is a fiction writer not a historian.