This is the "Nuking the Naval Review" problem. It is an absolutely legitimate target, but it's got PR issues, no matter how justified (or not) your cause is. Winning is important for Ukraine, yes, but poor choice of targets can turn public sentiment very easily, even if those targets are legitimate. Approval of Russia is low, even internally, even among the military, approval of the Ukraine is currently high pretty much everywhere. Russia doesn't need good PR internally or externally, so there's no need to give them an excuse to get some. Ukraine on the other hand is heavily reliant on outside forces thinking highly of them, and they can't afford to lose that.
I'm not saying it was an illegal target. Just a poorly chosen one.