If you really wanted him to stay in your life, then perhaps you shouldn't have nagged him about his gross habits.
The thing with relationships is that we need to accept our partners warts and all. Now there are many warts which many of us will not accept - and rightfully so! But if we choose to spend our lives with someone, it must be with acceptance of who they are.
If we can't accept a person's idiosyncrasies, we will nag. And when we nag too much, they will get tired of it and leave. And this is their prerogative.
You had two choices with this guy: Either accept his piggish habits and keep him around. Or don't reject his habits and leave. But it's not OK to try and nag or bully someone into becoming someone they are not.
Never regret anything that has happened in your life. It cannot be changed, forgotten or undone. So, take it as a lesson learned and move on.