Well, I'll pretend you answered me, then. I think there are a couple things at play. One - sex feels good, so it's natural (for some people) to seek it out, if, say, one isn't having it anywhere else. Two - sex offers very obvious proof (unless it's the bad 'oh god, how can it be that small' kind of sex) that someone wants you in some capacity, which is also appealing, as we all want to be wanted and to belong. It is just a bandaid solution, though, as I'm sure you know.
Now as to why you specifically seek validation in random strangers, my off-the-cuff, not at all in depth guess would be that you want number two up there more than you want number one (though, of course it factors in). I think you feel like you aren't... I don't know - loveable? Worthy? Whatever. And having sex with some rando is a way to try and prove that feeling wrong, however briefly, or at least defy it.
As to why I engage in anonymous sex/validation-seeking - well, I'm not very good at analyzing myself. Mine is a similar combination. I like having sex and I like it when people like having sex with me. I also like knowing people like me, and sex is easy. It's easier than getting to know someone.