If you have been detained and removed from the UK, you will need to declare it when you apply for your student visa. It's best to include a copy of your removal notice(s) with your application and to put their reference numbers on the form.
For your question about whether a removal affects future applications, yes of course it does. It is not an automatic show-stopper, but it reflects upon your credibility and your amenability to comply with a visa's terms and conditions.
Based upon what you wrote, they thought you were concealing a relationship and this generally signals an intent to settle in the UK by making an Article 8 claim (jumping queue). People who are maintaining romantic relationships invariably try to downplay their significance during a landing interview and there's a very grey area between 'friends' and 'boyfriends' that confuses a lot of people. They also believe (rightly or wrongly) that some people on student visas are trying to form a permanent relationship and settle here (probably that's why they called your bf... to catch a discrepancy). If a relationship suggests intimacy and you describe it as 'friends', they will think you have lied. Once they catch someone in a lie, however innocent, they will start on the removal track and it's all but impossible to recover from it.
What should I do when explaining the past refusal? The narrative in your question is fine, you can reword it a bit and put it in your application. They are not asking for a confession of guilt and they will not appreciate a long-winded contrivance that attempts to gloss over the story (it will just dig you in deeper). You can write one or two paragraphs that stick to the facts and that will be fine. The rest of your application should be of the highest quality (using a high street solicitor with a practice area in student visas if need be).