There are two types of tanking: type A tanking, tanking the entire season. And type B tanking, tanking when you realize you're not gonna make the play-offs.
Type A tanking is very hard to fix. What we often see, is type B tanking, though.
To fix type B tanking, just ignore the late games in the season. Just use the first half of the season for teams who don't make the play-offs , with or without the lottery.
Have a small pre-lottery lottery after the season on the game-number cut off, say in the range 40 to 60, so we reduce the fun in scoreboard-watching just before game 41.
So everybody could quit with the stupid tanking and "must-lose" game talk. At least in the second half of the season? And in particular in the closing stage of a season.
Problem fixed.
Suggestions on having the lottery before the season starts will still mean teams will be in situations where losing is good for their draft. Namely, when the lottery gives first pick to last team. Things like that.
Also giving better odds to teams who is eliminated early will reward underachievers, "now we are out, now we can win and make a better impression". That's not why you should win. You should win because it is fun. This would reward type A tanking, horrible.