You won't like the answer... when you are a good person you will attract people who may or may not be good to you.
You did nothing to cause his behavior, he is responsible for it.
Learn from it and choose wisely the next time. I wish I could do something for you, it is a tough position to be in. My sitch gets a little better but every inch is hard. We live in a world where things are both easier and harder. It doesn't help to focus on the blame but on the day - on what really counts - on who you are as a person and your way in the world. Get angry and let it go. Don't hold onto it.
And if I just hit a wrong chord with you - yell back at me I have broad shoulders. Have a good night.