It is legally grey considering Blizzard themselves released the source code. Asking for money, however, is illegal. Even in form of a paywall through donations. Donate paywalls are a legally grey area that has never been argued in court. Blizzard says in their ToS but again that isn't law, it is a contractual agreement, but you never actually sign it. Depends on the judge you ask, some will tell you that you have to physically sign it, some will tell you that by clicking accept you agree to it. Problem is, locking something behind an agreement like this, and then releasing the source code. That is why actual servers get taken down but the repacks themselves are never messed with by Blizz. They don't care if you and a few friends play, but they will protect their IP if you get large enough as a server owner. Blizz by their grace allows us to play around with stuff. This ensures that the game will outlive the paid version for those of us who love WoW and they know this. They know that we love the game more than they do, for them it's about making money, for us it's a passion, so they let us have our cake as long as we don't disrupt their income, hence why I pay my sub fee while playing with repacks.
The servers are legal in one way which was addressed via the original post - no income is generated by the server (whether an access payment or "donation") and the server owner and players have purchased the equivalent expansion. Tons of private servers, which used payments or donations, have been threatened or sued by Blizzard however their activity seems to be slowing down as of late. More are free servers that generate income via website-based ads.
There is also the option of hosting the server in a country that doesn't care about EULA and software agreements, and Blizzard probably doesn't want to pursue due to difficulty with foreign courts.
In my onest opinion Private Server are "legal " but until Blizzard decide to shut down all via legal actions. I think Private servers barely affect the Blizzard economy perhaps Blizzard ignore them from the legal and economical aspect, but in my opinion the best WoW is the repack you compile for yourself or the Retail, Private Severs will all end one day, just see what happened many years ago with Molten-WoW or with many more.
It is illegal once money changes hands other than to Blizzard. It is illegal, as this is a form of Pirating software outside the terms of agreement that the Intellectual Property Owner, Copyright Holder Blizzard have claim.
It's similar to streaming/DL any movie or licensed product. However, as any good pirate would tell you, its easy for a large company to justify to the courts why the small have caused their purse to be lighter.