For tasks that aren't straightforward to measure impact on bottom line, perhaps their impact can be approximated via product owners setting bounties on them.
In any case as important as things like code quality are, they are ancillary to the bottom line of a business. Employers hire employees to increase the profitability of their business, and code quality is not the top priority.