Because they would have to share their intellectual property with their direct competitors. They also aren't exactly friends, the 2 companies are huge competitors trying to outcompete the other constantly
There's also a lot of issues that would come with this. Who would get the bulk of the money made from the movie? Will each company gain access to new IPs? If someone records the movie & posts it to Youtube, who is the one that copyright strikes them? Would Marvel or DC get that money? Or would they have to split it? Giving up 50% of your profits to your direct competition doesn't seem like the best idea from a buisness standpoint
What about toy sales? Would Marvel make money from a Batman figurine from the movie? Or what about streaming? Would DC make money from the film being streamed on Disney+? Would we have to put DC movies on Disney+ since they're canon to Marvel now? What do you do next after the big crossover movie? After a big crossover like this, returning to the individual universes would feel way less special & straight-up might drop sales after the crossover
But the real reason is because a former executive of DC Comics, Dan DiDio, made that pretty much impossible after Marvel & DC's last crossover. Dan DiDio even said himself that Marvel is their rivals, and that by crossing over with them, they pretty much admit defeat since they're acknowledging that their universe isn't good enough to stand on its own & they need the assistance of another company. Is that true? I don't think so, but that's why DC doesn't want to crossover with Marvel and why we probably won't get a crossover movie anytime soon
The movie would be a money printer, and I'd give anything to see it, but it's just not going to happen anytime soon