This is a problem most commonly seen in junior developers. It leads to them making poor decisions that are not aligned with business goals.
> I'm glad I program because I enjoy it
Spend enough time working in the industry and that will go away.
For your mental health's sake, I hope you find a hobby that is unrelated to your job. What you are describing is a very common path to burnout. Been there, seen many classmates go through it as well.