Referring friends allows you the role of bridge building. You can discuss about the job requirements and work place culture and processes and prepare them. With friends, beside you being able to market their strengths to the hiring manager, you can openly discuss with them about how you view their suitability and how they can prepare to succeed in applying for and striving in your company. If they lack some skills, you can point that out and help find ways for them to learn those skills so that they can sooner be productive. This is all good for you, your friends and the company. Also as you know your friends, you can act like a good mentor for them, helping them succeed once they join as your colleagues.
If you think a friend is not a good fit, you can also communicate this to him/her, and depending on in which ways you value your reputation or that particular friendship if it would be affected by your refusal, you can shape your approach in introducing (or not introducing) him/her to your company. If there is difficulty in shaping your refusal to introduce a friend to a company, you might find help in interpersonal stack exchange, as this question is out of context here.
Basically I am saying that, because you know the candidate, a currently poor candidate in some cases can be coached to become a good fit if you have some days, weeks, or even months available. Or poor candidate, with your insider insight, can himself/herself make the decision that the job is not good fit for him/her.