An additional important fact is that the EULA at the time did not assign Blizzard the rights to custom maps.1 And since 2010, Blizzard and Valve have jointly registered DotA-related copyright. See e.g. U.S. Copyright Registration Nos. TX0008153084 and TX0008149056.
The theory of ownership is as follows. Because the EULA did not assign Blizzard the copyright in the customization, the modders gained copyright in those, despite the restriction that they not be used commercially. It was then free to them to transfer those rights to Valve.
A court has considered in passing whether this assignment to Valve was valid. See Blizzard Entm't, Inc. v. Lilith Games (Shanghai) Co., Ltd., No. 3:15-cv-04084-CRB (N.D. Cal. May. 16, 2017).
The judge recognized that the EULA explicitly prevented Eul and Icefrog (the modders who assigned their rights to valve) from using their creations for commercial purposes. However, because uCool "twice failed to argue that the ban prevented Eul and Icefrog from validly assigning their rights to Valve," the judge understood uCool to have waived that argument.
Thus, the status of the copyrights is still in flux. However, commentators speculate that Blizzard and Valve have an agreement/protocol for dealing with these copyright issues.
It would take a third-party to argue that copyright in one or more of the DotA variants is in the public domain or actually owned by some other creator and force a court to assess the copyright and validity of the assignment.2
1. Today, the language has been updated to "assign to Blizzard all of your rights, title, and interest in and to all Custom Games."
2. For one person's theory of how this could be the case, see David Nathaniel Tan, "Owning the World's Biggest eSport: Intellectual Property and DotA" (2018) 31:2 Harv. J.L. & Tech 965 at 984 (analogizing to Sherlock Holmes). I am not suggesting that a third party with no ownership interest in the copyrights would have standing to enforce Blizzard's former ToS, ELUA, or other agreements, or its copyrights. I am proposing that the third party might raise these as an arguments in defence of their own use (as uCool did).