About the software you wrote as wasn't even used said: that st happens, and we can't get too attached to the things we produce - https://en.wikipedia.org/wiki/Sunk_cost right?
Think back of the times when you were actually excited and driven to write software. What was different back then? You probably had an awesome team and build some really cool and interesting stuff.
Take some time off, 2-3 weeks and change your environment. I.e. long cruise, backpacking through Europe or South America. Something that will pull you completely away from technology.
You need to rest your mind.
When you come back, if you think your work sucks, or your job sucks, then go out there and find something that aligns with your values. There's plenty of software to be build, and plenty of people building it, some of which align closely with your values. You just have to keep looking.