They did that - it's called Minecraft Bedrock and is written in c#. The problem is that it's not a 1 to 1 copy of Java edition and much of the functionality differs, so most PC players prefer the Java edition as it reflects the original gameplay.
Far more importantly than "original gameplay" although there are deviations that would matter enormously for e.g. speed running, you can't mod Bedrock.
I don't actually play vanilla (unmodified) PC Minecraft more than perhaps a few minutes every year to see what's new or test something in the vanilla program.
But I spent hours every month playing packs like Compact Claustrophobia (a pack where you spend all except the last section of the "plot" trapped inside Compact Machines, pocket universes which don't exist in the vanilla game at all but are fairly popular in modding). Or say Seaopolis which starts out in a vast world-covering ocean but eventually allows you to do space travel.
Mojang and then Microsoft did some basic work to enable this, but a huge part of it comes from the core being Java, and so once modding is allowed it's possible to reach inside an object and replace parts of the game wholesale. And from the contingent popularity and huge community that took this and really ran with it.
Modding enables people to focus on the type of play they most enjoy. If you wish the game had more tricky combat and needed survival skills, you can have that. If you'd rather become a God-like being and form the world as it should be, you can have that. If you like problem solving, you can spend all your time building complicated machines to solve increasingly dubious problems (e.g. don't think "automatically farm carrots" think "automatically farm dragon eggs").
> This version is programmed in C++ and is available for a multitude of platforms including iOS, Android, VR, Xbox One, and Nintendo Switch. Since the Bedrock engine is a full rebuild different from the Java Edition, there is a noticeable difference between Bedrock and Java edition.