Somebody turned you in and it led to a removal (these things happen sometimes with freelancers) and you want to know if the event will affect an upcoming T4 application.
Basics. When you were removed, they gave you some form(s) and took your biometrics, hang on to the form(s) because they will have your reference number on them. You will need it later.
I assume you're American ("in the state where I live"), and when they remove an American (or any other non-visa national) from a port, it means the person has breached something in Paragraph 320 of the General grounds for the refusal of entry clearance, leave to enter or variation of leave to enter or remain in the United Kingdom. These are mandatory grounds and they have no discretion in the matter. The general grounds are also summarized and partially restated in Part V9 of the Visitor Rules and these include statements about exclusion for the public good and exclusion for criminal history which I assume do not apply in your case.
Colin Yeo has this to say about Part V9...
In fact this part reintroduces the general grounds for refusal from
paragraph 320 of the Immigration Rules but in plain English. This
mandates or requires refusal of an application in some circumstances
(‘will be refused’) and enables discretionary refusal (‘will normally
be refused’) of an application in some circumstances.
In both cases, the general grounds cover a lot of area and there's not enough info in your question to determine exactly which grounds governed your case, and unlike a visitor refusal it doesn't matter what language they used or what they told you. Their job is to get you out of the UK with as little fuss as possible. One possibility is that they concluded that you engaged in deception, or that you were an illegal entrant, or that you were up to something not covered by the rules, or that you breached a condition previously.
An application for a student visa (T4) is on the points-based side and hence you have no claim to human rights. As a rule of thumb, they would not grant a T4 to a person who has been previously removed on general grounds, and I would be very surprised if your application succeeds.
To get a better feel for what the Entry Clearance Officer will be looking at when you make your application, you can submit a Subject Access Request. Since you are outside the UK, there will be additional steps before they release your file so it's a good idea to get started right away (this is one of the times you will need the reference number I mentioned above. Without it, you need to add lots more time for processing the request).
Once you have your file (and if the critical parts have not been redacted), you will be in a better position to assess whether a T4 application is worth it or not.
Finally, if my assumption that you're American is correct, you can drop by here and get a discussion going about your particulars (or have them read this answer for the background). Adding... The OP's thread starts here.