Ignoring endorsement deals (which are astronomically higher for a NBA player), do remember that the LeBrons and the like make ~20 million, so the scale is off a bit in the comparison.
Lastly, when your effective playing roster is MUCH smaller in the NBA, it's easier to see where your paycut went to bolster the lineup opposed to talking a sweetheart deal and hoping the savings materialize when spread over the other 22 players on the team.
It's optics and small handful of players wanting to get championships that drive this false narrative.
And while I don't agree w/ your lockout/players being greedy viewpoint, if hockey players came from the socio-economic background that many basketball players do, hockey players would probably be viewed differently (rightly or wrongly)