OP I'm sorry that you and the poor sheep had this experience.
I'm a dog walker, and have chatted to behaviouralists about this issue.
IMO (and that of the behaviouralists that I respect) it is incredibly hard, or maybe even impossible, to reliably train a dog out of this. You can reduce their reaction to livestock, you can gain a solid recall and a reliable 'leave it'. However, when push comes to shove if a dog is triggered in a certain way instinct and adrenaline may kick in and take over.
This is especially an issue in terms of prey drive with terriers and sight hounds, but all dogs carry a risk.
They are more likely to be triggered if potential pray runs, makes a frightened noise or startles them by appearing out of nowhere.
It doesn't make your dog bad. It's normal dog stuff, but obviously unacceptable. Believe me that time and time again the most placid, well trained and human friendly dogs attack and kill chickens, deer and sheep simply because the opportunity arose and they lost their head in the heat of the moment.
So, the answer really is to keep your dog on lead in an area of livestock. I never make an exception to this rule for any dog that I walk no matter how well trained. Luckily I'm able to find plenty of livestock free walks locally. Although you can never discount the possibility of a squirrel unfortunately.
Anyone who trusts their dog 100% with livestock is taking a gamble, with the exception of dogs which are working the livestock accompanied by their owner.
The issue that you have OP, is that you want to enjoy the moorland and aren't sure if you're likely to come across sheep again. Could you ask around to see if this was an isolated incident in which case it's not your fault and providing you keep your eyes peeled, your dog fairly close and lead-up if you can't see what is ahead you should be fine. Take binoculars if that helps.