It would definitely be hurtful to be on the receiving end of what he did. And this is probably not the first time he's done this to someone. People can be full of multiple intentions, however. A man can be interested in marriage but still want to have extra women on the side. In most cases men will hide these inclinations from other women.
In the most classic context, this is nature's struggle. Since the beginning of time men have been interested in having as many intimate partners as possible, and women have been interested in nurturing the right relationship.
I am going to ask you a few questions. Did he ever tell you he was exclusive with you? Did he make it sound like he wanted to marry you specifically or that marriage in general was his end goal? Many men will take the opportunity to have as many partners as they can, especially when they're young. Was it possible that you felt he was on the same wavelength with dating you without getting confirmation from him?
Success in online dating is very random. You can have the best intentions to get into a wholesome relationship, but if the other person is playing games or not being forward, or if both people are not at the same understanding of where they stand, things can quickly unravel.
Just protect yourself emotionally and physically when you're out there. This might not be the last time you encounter this situation.