We know what you're thinking. There is no way we're basing this theory on the fact that they were played by the same actor, right?
David Tennant For Every Role 2016
That's exactly the kind of thing they want muggles to believe! Your keys weren't shrunk by a wizard; you just "lost" them. That statue didn't move when you blinked; it was just gravity. That old blue police box in front of the street is just some leftover from a garage sale. But if you look closer, you start to see that there are eerie similarities between the two men, and that the Tenth Doctor, also known as the best Doctor, became Barty Crouch Jr. in order to help save the wizarding world from He-Who-Must-Not-Be-Named.
Why Would The Doctor Do That?
Despite coming off as evil in the books, Barty Crouch Jr. is the one who really sets the stage for Harry Potter to eventually defeat Voldemort. If it wasn't for him, Harry wouldn't have known that his wand's core was a twin of the Dark Lord's, and having this information is vital in helping him win future battles. Crouch was also the reason for Cedric Digory's death, which was tragic, obviously, but was also the rallying point for the creation of Dumbledore's Army in the fifth book. The members would play key roles in the Battle of Hogwarts, thanks to the special knowledge they had gained from Harry's instruction.
Some more hands-on than others.
If it wasn't for Crouch's actions, there is a good chance Harry would never have defeated Voldemort.
But How Did He Even Know About That World?
The Doctor, as awesome as he is, is also technically a muggle like the rest of us magic-less chumps. Wizards probably wouldn't exactly be willing to open up about their super-secret community to him, even if he did just land a freaking spaceship in front of Hogwarts.
But the Doctor is clever, and we can assume he has suspected that magic is real for some time. A big premise of the magical world of Harry Potter is that it is hiding right under our noses, but the Doctor has indicated he might be aware of it. In the episode "Face The Raven," we learn that hidden places, similar to Diagon Alley, exist in the Doctor's London, and that he knows how to find them.
There is another way he could have found out. As distrustful as wizards are, there is one muggle they always share their secret with: the prime minister of Britain. And the Doctor was also close friend with at least one prime minister, Harriet Jones. She might have spilled the secret to him, or he might have gotten it out of her another way.