This is one of the most common struggles with any artistic pursuit, and there are a few possible reasons why it could happen. From my own experience, and from watching others, it tends to come down to 3 different areas. I don't know which applies to you, so take or leave them as you wish:
1. Your taste is better than your skill. When you first started out, your taste was equal to your skill, so everything you first made sounded good because you just didn't know any better. As you continue to make music, both your skill and your taste improve, but not at the same rate:

Your understanding of what is good will always increase faster than your ability to create what is good. So it's important to lower your expectations just enough so that you can push forward and
keep making art.
2. You're relying too much on your memory of music and the emotional impressions of the songs you love, and working inside a vacuum. When you're working on a song, your only basis for comparison tends to be "the way it sounded before vs. the way it sounds now." That comparison doesn't tell you whether it's better or worse, it just tells you whether it's different. The best way to fix this is to reference other songs, both before you start writing a song and throughout the entire process. Spend some time
studying song arrangements, and go further: recreate the whole songs. Write down all the different attributes you figured out, and use that to develop your analytical ear. Then, every time you decide to start a song start pulling attributes out of that list and decide on some songs you can use for references. Pull those songs into your DAW, and every time you feel stuck you can compare your song to the reference and ask "What are they doing that I'm not doing? What are they not doing that I
am doing? Do I like those differences? If not, what can I do to change my song to be similar without directly ripping them off?"
Eventually, you'll need to compare the songs less often and the things you're comparing will become more detail-oriented. I think everyone should reference before they finish the song just so they're not living in the dark, but you'll rely on them less and less.
3. You've put making music too high on a pedestal and you've psyched yourself out of being able to write music. You sit down with the intention of writing fully realized and perfectly crafted songs, and forget that no fully realized and perfectly crafted song starts out as one. Everything starts out as a first draft, and first drafts
always suck. So instead, focus on just trying to do one thing. "I'm gonna design a bass patch today." "I'm gonna write three different chord progressions, and save the MIDI to a new folder called 'Chord Ideas' for later." "I'm gonna write a few drum loops." Collect the seeds of ideas and use the best ones as foundation points for your next few songs. Keep the rest for later, and if you think of a way to change or use them you now have a library of ideas to draw from instead of having to constantly be focusing on new material.
I hope this helps. Take a look around, and in particular look at some of the videos in the Tutorial Videos thread over in Sound Design. I've posted a bunch that focus on mindset and workflow, and they might help you out of this rut! The most important thing is that you keep making music.