Yeah that’s not what they’re preventing. It’s to stop someone with rights to generate keys, i.e. the developer, from generating a lot of Steam keys and then selling them on their own site at a discount, which is basically leeching off of the Steam infrastructure & ecosystem while sidestepping the storefront. Which is fine as long as they don’t undercut.
The EULA for any software you’ve ever paid for is what forbids resale.