Time, money and expertise are the primary drivers.
Every game that allows any sort of UGC runs the risk of people creating giant penises, butts, religiously offensive materials, and more. It's a huge, huge risk to make something allow UGC (on console, especially).
It's not easy to design, build, test, and iterate on modding tools either. When you ship to multiple regions, you have to be aware of the regional restraints/laws/rules around customer created content. You have to ensure that naming conventions for user generated content are safe (usually these days, devs & publishers just go for a time/date stamp as the name of the UGC content, so people can call it, "Dis $HIT is Fukng BOMB!"), you have to ensure that the mechanisms you build don't allow people to build content that can cause photosensitivity seizures (imagine if you gave people the tools to make textures flicker at any rate, people could abuse that to create visuals which would cause wide-spread seizures)... not to mention, there are all the functional issues that come along with allowing people to build their own content... and of course, there are also political/contractual difficulties in some cases. For example, as Topdawg mentioned, if you built a game in UE4, and you essentially gave your audience simplified UE4 tools to use to mod your own experience, you're potentially building something somewhat competitive with the engine you're licensing, and that opens you to litigation from the owners of the tools you licensed...
Honestly, no one really cares at all about "modders making the team look bad", or "Devs and publishers don't want people messing with their vision" - none of that really matters. That's just pretentiousness. Sure it might exist in a handful of cases, but by in large it's just expensive and risky to enable UGC in your game... and some people are more willing than others to take that risk... but the bigger an entity you are, the bigger target you become for lawsuits... and one missed problem which offends, or which allows users to do something "bad" could cost you all of your profit from that game's release... or worse, drive your whole company to bankruptcy.
If a company wants to enable UGC, they have to be willing to accept the many risks, they have to have the expertise to be able to design the tools properly, and then they need the resources to build and test those tools... and many companies simply aren't willing to take the risk (large publishers), or don't have the expertise to make it happen (too small of a dev house).
Sadly, business is business, and when a potential risk (if encountered) would substantially negatively impact the monetary prospects of a title, then that's a risk that's best to simply avoid.