Quoting the Buddha is a popular internet pastime. However, quotes out of context aren’t much help to anyone, so here’s a brief commentary on the Buddha’s supposed charter for non-dogmatic free enquiry, the ‘Kalama Sutta’ (AN 3.65)…
BUDDHA QUOTES IN CONTEXT: THE KALAMA SUTTA (AN 3.65)
” Don’t go by reports, by legends, by traditions, by scripture, by logical conjecture, by inference, by analogies, by agreement through pondering views, by probability, or by the thought, “This contemplative is our teacher.” When you know for yourselves that, “These qualities are unskillful; these qualities are blameworthy; these qualities are criticized by the wise; these qualities, when adopted and carried out, lead to harm and to suffering” — then you should abandon them… When you know for yourselves that, ‘These qualities are skillful; these qualities are blameless; these qualities are praised by the wise; these qualities, when adopted and carried out, lead to welfare and to happiness’ – then you should enter and remain in them” – The Buddha. 
“On the basis of a single passage [above] quoted out of context, the Buddha has been made out to be a pragmatic empiricist who dismisses all doctrine and faith, and whose Dhamma is simply a freethinker’s kit to truth which invites each one to accept and reject whatever he likes.” – Bhikkhu Bodhi. 
Contrary to popular belief, the Kalama Sutta isn’t a charter for “free thinking”, agnosticism or intellectual laziness. The sutta is both “a guide for the perplexed” and a guarantee of spiritual liberation.
The Kalama sutta was given to a particular audience in a particular time, place and situation. This context must be understood, as is the case whenever one hears or reads the Buddha’s words.
The Kalama’s are residents of a town called Kesaputta. These townsfolk have heard different teachers criticising one another and expounding contradictory views about the reality of karma and rebirth. Understandably, they are doubtful and confused. However, when the Kalamas hear that the Buddha is in town they seek him out and they respectfully ask him: “Which of these venerable brahmans and contemplatives are speaking the truth, and which ones are lying?” 
The Buddha immediately consoles the Kalamas, telling them that their doubt is justified. He then identifies ten doubtworthy criteria, and he advises the Kalamas to examine whether views founded on such criteria are morally wholesome or unwholesome, and to reject them if they are unwholesome. The ten doubtworthy criteria can be grouped under three broad categories of knowledge:
Knowledge by way of tradition
1. Aural and oral revelation.
2. Lineage or received wisdom.
4. Scriptural authority.
Knowledge By Way Of Reasoning
6. Inference and deduction.
7. Reasoned thought, specious reasoning.
Knowledge By Way Authority
10. Teachers, reputable persons. 
It should be noted that the Buddha is advising the Kalamas not to rely solely upon tradition, authority or reasoning when assessing teachers and the wholesomeness or otherwise of their doctrines. He isn’t telling them that tradition, authority and reasoning are completely useless and have no place in intellectual or spiritual matters. The Buddha advises the Kalamas to heed the words of “the wise” (i.e. community elders). Nowhere in the Sutta does he tell the Kalamas that his teachings should not be accepted. Nowhere does he tell the Kalamas to select or reject or revise his teachings according to their own personal likes and dislikes.
As Piya Tan  has pointed out, the ten doubtworthy criteria are closely related to Buddhist epistemology (i.e. how we know things). Only through the direct experience of mental cultivation (i.e. developing morality, concentration and wisdom by practicing in accordance with the Noble Eightfold Path) can we gain the knowledge leading to spiritual awakening. Our direct first-hand knowledge of phenomena is small compared to the second and third-hand information (mostly unverified, very often half-truths and hearsay) which our minds are filled with. Nevertheless, discussing and thinking about dhamma, when done mindfully, can help us see through such delusions.
Tradition, reasoning, and authority are the actual means by which the Buddha’s followers develop right understanding of the Four Noble Truths and are motivated to initiate right effort for an experiential spiritual awakening. In the sutta, however, the Kalamas have yet to accept the Buddha as their teacher and so he refrains from mentioning right view to them.
Instead he employs a Socratic-style of questioning that leads them to appreciate the importance of rightly understanding greed, hatred and delusion. The Kalamas agree that actions motivated by the three unwholesome roots of greed, hatred and delusion are morally unworthy, censured by the wise, and bring about bad karmic fruits. On the other hand, actions motivated by the three wholesome roots of non-greed (charity), non-hatred (lovingkindness and compassion), and non-delusion (wisdom) are morally worthy, praised by the wise, and bring about good karmic fruits. The Buddha thus offers the Kalamas an acid test for gaining confidence in the Dhamma as a viable doctrine of liberation.
Finally, the Buddha tells the Kalamas that a “Noble Disciple” (i.e. an accomplished jhana meditator) dwelling mindfully with an attitude of universal good will, compassion, appreciation, and equanimity; having overcome greed, hatred and delusion, acquires the following four reassurances:
“‘If there is a world after death, if there is the fruit of actions rightly and wrongly done, then this is the basis by which, with the break-up of the body, after death, I will reappear in a good destination, the heavenly world.’ This is the first assurance he acquires.
“‘But if there is no world after death, if there is no fruit of actions rightly and wrongly done, then here in the present life I look after myself with ease — free from hostility, free from ill will, free from trouble.’ This is the second assurance he acquires.
“‘If evil is done through acting, still I have willed no evil for anyone. Having done no evil action, from where will suffering touch me?’ This is the third assurance he acquires.
“‘But if no evil is done through acting, then I can assume myself pure in both respects.’ This is the fourth assurance he acquires.
“One who is a disciple of the noble ones — his mind thus free from hostility, free from ill will, undefiled, and pure – acquires these four assurances in the here-and-now.” 
As Soma Thera writes:
“The four solaces taught in the sutta point out the extent to which the Buddha permits suspense of judgment in matters beyond normal cognition. The solaces show that the reason for a virtuous life does not necessarily depend on belief in rebirth or retribution, but on mental well-being acquired through the overcoming of greed, hate, and delusion.” 
On hearing the Buddha’s advice the Kalamas are persuaded to seek refuge in the Buddha, refuge in his teachings, and refuge in the community of Buddhists. Within Buddhism faith (saddha) is akin to trust or confidence in the Triple Gem (Tiratana) and is never regarded as an end in itself nor as a sufficient guarantee of liberation. Such faith is regarded as the starting point for an accurate grasp of the Four Noble Truths, which in turn motivates the energy and resolve to pursue the Buddha’s eightfold system of training said to result in personal insight and liberation from the rounds of death and rebirth (samsara).
 “Kalama Sutta: To the Kalamas” (AN 3.65), translated from the Pali by Thanissaro Bhikkhu. Access to Insight (BCBS Edition), 30 November 2013.
 “A Look at the Kalama Sutta”, by Bhikkhu Bodhi. Access to Insight (BCBS Edition), 5 June 2010.
 “Kalama Sutta: To the Kalamas” (AN 3.65), translated by Thanissaro Bhikkhu.
 “Kesaputtiya Sutta The Discourse to the Kesaputtiyas” (A 3.65), translated with notes by Piya Tan, The Dharmafarers, 2011.
 “Kalama Sutta: To the Kalamas” (AN 3.65), translated by Thanissaro Bhikkhu.
 “Kalama Sutta: The Buddha’s Charter of Free Inquiry”, translated from the Pali by Soma Thera. Access to Insight, 7 June 2010. Retrieved on 4 February 2013.