A liability isn't an inherently bad thing.
A loan is a liability, but you might take one out regardless because you know you can use it to make more money than you'll have to pay back in interest.
That said, I think it's more correct to characterise code as a depreciating asset, as another commenter did.