Obviously Kovalchuk takes the majority of the blame for this. Don't sign a long contract you don't intend to play out.
But the NHL structure is partially to blame as well. We live in a cap world, and have to contend with the fact that NHL teams can now be outbid by KHL teams. (Whether players should trust that money or not is a different question.) Also, Kovy might have felt that the deal he signed was negated when the NHL decided to lock the players out unless they took a paycut. What's the point of honouring a 17-year contract when your employee decides they'll make you take a cut every five or six years?