He wanted a hookup. Regardless of what you said. Then it went a bit and he thought he could convince you. He realized he couldn't so, rather than either force you (very bad) or end up jerking off in his bathroom, he got distant.
Here's a tip. If you don't want to have sex with someone, don't hang around their home, alone with them. Particularly not after you've just met in person. Particularly not after all the pushing for sexting, for nude images (this is jerkoff fodder), etc.
Of course being alone in someone's home does not 100% equal sex. But to him this was a fairly clear signal that you could be persuaded. When you couldn't be, he got pissed off.
BTW, don't go back and apologize, or think you have to fix anything about yourself except (a) maybe not trusting strangers so much to go to their homes, alone at a first meeting and (b) maybe not trusting someone who is so all over the place re commitment, relationships, sexting, etc. Because from this perspective, he just seems like a guy who wanted to get into your pants and, likely, a bunch of other girls'.