ugh. Well, trying to stop her creates a romeo and Juliet situation. But she is foolish to buy into that friends with benefits baloney. That ends in someone having hurt feelings almost always.
Anyway, high school is supposed to partly be about the experience. How is she going to go off to college if she can't be self motivated and have self control to get her stuff done? I understand your concern . . . but gosh, this is a bigger problem than her liking boys. She's been apathetic about school. You can tell her its important all you want and it doesn't mean she'll see it that way. I hope she does realize though in enough time to get better habits.
So, maybe try having her social life as a reward. I know that my school system has checks and balances for parents. Progressbook is common --- does your district use this? Basically its a window into any and all grades, missing assignments, late work, etc. You see it all. You chart their progress in all of their classes. Whatever system your district uses to monitor kids, sign up and pay attention and allow her to earn her way to having friends, fun and a boyfriend. Going out on Friday night? You need to have X,Y and Z done during the week along with whatever your minimum achievement is in her classes for that week. If not, she has another chance the following week.
I wouldn't allow her to spend the night at a guy's house though. Sorry, she's only 17 and that's inappropriate. friend or friend with benefits. I would not allow that.
That's my 2 cents. Good luck and let us know how it goes