Don't beat yourself up. An occasional treat isn't a failure.
The most important thing is that you don't get into a regular habit of doing it too often. The spiral of doing this and taking higher and higher doses of insulin to handle it starts to get a bit messy over a period of time, and it is easy to then end up having the higher doses and feeding the insulin consistently instead of when you are having an occasional treat. That's when unexpected and potentially dramatic hypos can take place.
Enjoy the treats now and then, and carry on your good work the rest of the time.