If you use the search option closer to the top, you may be able to find other posts that may answer your question.
From what I have read, if you were denied trying to enter the UK once in the past and then later make an application for entry clearance on the Spousal Visa, it shouldn't have too much effect on the decision. Applying for the visa alone shows you're going through the proper channels and by then you will be married. Of course, I believe the application may even ask you if you have ever been denied entry to the UK before, and you WILL have to disclose this. The good part is that you can include a further explanation as to why, and this may clear up any worries about the previous denial.
Either way, there are tons of helpful people here at UKY who can offer you further advice and share their own experiences. Good luck!