I'm going to apply for a job to compete with a friend who is struggling to find work
Why would you compete with your friend?
I hope it motivates him to try harder, after I refused to hire him.
Just because YOU wouldn't hire him, it doesn't mean that no one else will. You are not really his friend if you're willingly hurting him based on a subjective judgement of his job ability. You shouldn't be trying to harm him at all in the first place.
I don't know why he is not getting a job.
Stay out of your friends way. Try to have some compassion, you sound so selfish. You could try to give them a good reference to get that job.