Self critique leads to improvement.
This is not to say be overly hard on yourself, or criticise your work to the point of demotivation, but that disliking old pieces of work created can inspire rather than destroy.
When looking at an old piece of work, ask yourself exactly what it is you dislike, and compare this with something you do still like about it, even if it's subtle. By forcing a deeper understanding of exactly what you do and don't like in photography, you are able to consider these next time you take a photo.
For example, you may like the lighting of an old photo, and revisiting that shot should therefore remind you of how you used light to your advantage, encouraging you to mimic and channel that same technique next time. In that same shot, you may notice that the composition wasn't great, and rather than disregarding the photo without analysis, this should be your main focus for the next time you shoot. If you're in a similar location, looking to create a similar shot, focus specifically on the way you're composing your photo this time, and try lots of different compositions to learn what you like best.
Further, disliking old photos you've taken doesn't mean you're a bad photographer - it means you've improved. I couldn't name a single good photographer who's still proud of their photos from when they first started out, and would personally struggle to even appreciate my own work from just six months ago.
Disliking your old work isn't necessarily a bad thing, but a chance to see your work free from self-bias and embrace the opportunity to learn.
So hate your photography as much as you like - sometimes you have to tear down a house to build a castle.