ANSWER: Jesus' somewhat humorous comparison of a 'camel through the eye of the needle' is mentioned in three of the gospel accounts (Matthew 19:23 - 26, Mark 10:23 - 27, Luke 18:24 - 27). He gave it shortly before his final Passover and death.
The context of the comparison is that a rich young man approached Jesus and asked what it took to have eternal life (Matthew 19:16). Christ delineated several of the Ten Commandments and the man answered that he had kept them from the time he was a boy (verses 17 - 20). Jesus then told him if he wanted to be "perfect" to sell all he owned, give the proceeds to the poor, and follow him! After hearing these words, the rich man went away sad. The Bible then gives us the camel phrase of your question.
Then Jesus said to His disciples, "Truly I say to you, it is extremely difficult for a rich man to enter into the kingdom of heaven. And again I say to you, it is easier for a camel to pass through the eye of a needle than for a rich man to enter into the kingdom of God" (Matthew 19:23 - 24, HBFV)
There are a few possible explanations for what Jesus meant by his analogy using a camel. Some claim there existed somewhere in Jerusalem's city wall a narrow gate known as the "eye of the needle." The explanation is that such a small gate made it impossible for a fully loaded camel to pass through it. The animal would have either to be fully unloaded or walk on its knees in order to traverse the opening.
The major problem with the above explanation is that archaeologists and other scholars have never found evidence of such an opening used by camels or reference to a gate referred to as the eye of the needle.
Several Bible commentators have noted the Aramaic word for camel is nearly identical to the word used for rope. Some believe that when the New Testament's original scrolls were translated into Greek an error in translation may have occurred. This would mean the text should read "it is easier for a ROPE to pass through . . ."
Additionally, it is stated the words "eye of a needle" refers to the small opening of the tool used to sew clothes and other things together. Trying to pass rope through such a small opening would certainly prove difficult!
A third possible, and likely, explanation is that Jesus was simply using a commonly used saying to underscore the spiritual situation of those who are rich. It is as difficult for the wealthy to do what it takes to be saved as it is for an animal the size of a camel to pass through a very small needle opening.
Note that in his comparison Jesus states it was "extremely difficult" (HBFV translation) or "hard" (NKJV, NIV, ASV, etc.), but not impossible, for a rich man to enter God's Kingdom. If it were impossible, then wealthy and faithful men like Abraham (Genesis 13:2), Isaac (Genesis 26:12-14), Jacob (Genesis 30:43), Job (Job 42:10-12) and many others would be shut out of eternal life. The Bible teaches, however, that they will certainly be in the first resurrection and enter the Kingdom.
When the disciples heard Jesus' analogy of a 'camel through the eye of the needle', they responded with astonishment and stated, "Who then is able to be saved?" (Matthew 19:25). Why would they be amazed it was hard for a rich person to enter the Kingdom? The Pharisees believed God gave wealth to those he loves. One Bible commentary suggests the disciples may have been influenced by some of their beliefs and therefore responded accordingly.