So, just to give another circumstance.
There's a chick on Facebook who has been desperately applying for a UK visa for about six months.
First she came to the UK and stayed for a six month visit with her boyfriend.
She then returned to the US and applied for the unmarried partner visa even though she and her boyfriend haven't lived together. So that was refused. (What this means is that she submitted an application saying she wants to move permanently to the UK and settle.)
She then tried to enter the UK to visit him and was held, questioned, and sent home - just like you.
She then applied for a visitors visa and that was refused.
I told her what she needed to submit to have a successful visa application. I also told her that I'd FREAKING WAIT a while before applying and either meet her boyfriend in a third country for a visit or have him visit her (wild idea, I know). She was hell bent on visiting him. She reapplied with all the paperwork I told her to include and got her visa today. Heck, even I'm surprised she managed to get an approval.
But it shows it's a tick box visa. She ticked the boxes (finally). She got her visa. She's probably driving to the airport as I type.
I still think she should let her boyfriend chase HER a little bit though.