I don't get the obsession with trying to condense this down to a single concept.
Code is necessary, sometimes we write good code that turns out to be an asset in both the short and long terms, sometimes we write mediocre code which is a short-term asset to our business goals but in the long term turns out to be debt. Sometimes we write bad code that will probably never justify itself as an asset because of the problems it a) causes and b) requires human intervention to support, patch or delete.
Same applies to code. Also code should first be proven to create value to be valued as an asset. In worst case, it may just be a pile of bricks devaluing the property.
It can be an asset because it solves A, but it can also be a liability because it makes it hard to implement B and C.
A house can be a liability too if you're required to pay for public services, for example. Sure it's an asset too, but like code, the liability-side might make it worthwhile to get rid of.
You won't know until later.