When you have left a long-term relatrionship, it is very easy to slip back into it, even on a 'temporary basis' as you have done.
You feel lonely and vulnerable, and to spend some time with someone who used to represent security and happiness, coupled with physical comfort and satisfcation is an easy pretend to indulge but ...
it is a pretend, and that is the important thing.
What you are doing is taking the bits of the relationship that make you feel better now, but none of the parts that split you up in the first place.
This feeling is unsettling, makes you wonder if you were right to split, and if it could work a second time.
It is an illusion. The 'nice bits' would wear off very quickly, and the problems wil surface, and you will split again.
You need to be strong. Stay away from him. Don't put yourself in a situation where sex is going to happen, it doesn't assist in clear thinking.
Concentrate on building your life without him. Se friends, go out, get comfortable with your own company, and these temporary 'was it right to split?' feelings will evaporate like the mirage that they are.
Good luck.