Wash trading (under that term) is illegal, but I looked it up and the writing on it seems like it mainly applies to the context of creating higher volume, not price[1], and the latter is what the attacker used here. Margin lenders on conventional markets generally avoid this attack by incorporating volatility in their collateral requirements -- a recent rally in the price would mean higher volatility and thus more collateral required.
[1] https://en.wikipedia.org/wiki/Wash_trade
https://www.investopedia.com/terms/w/washtrading.asp