Mormons are not allowed to drink coffee because of the Word of Wisdom, which is a health law found in the unique LDS scripture Doctrine & Covenants 89 whereby God supposedly commanded His people to abstain from hot drinks (interpreted as coffee and tea) as well as tobacco, excessive amounts of meat, and alcoholic beverages. Obedience to this health law is one of the requirements to receive a temple recommend. Those who keep these sayings are promised that “the destroying angel shall pass by them” (89:18, 21). According to tenth President Joseph Fielding Smith,
SALVATION AND A CUP OF TEA. You cannot neglect little things. “Oh, a cup of tea is such a little thing. It is so little; surely it doesn’t amount to much; surely the Lord will forgive me if I drink a cup of tea. Yes, he will forgive you, because he is going to forgive every man who repents; but, my brethren, if you drink coffee or tea, or take tobacco, are you letting a cup of tea or a little tobacco stand in the road and bar you from the celestial kingdom of God, where you might otherwise have received a fulness of glory? (Doctrines of Salvation 2:16).
Apostle Boyd K. Packer explained,
The Word of Wisdom put restrictions on members of the Church. To this day those regulations apply to every member and to everyone who seeks to join the Church. They are so compelling that no one is to be baptized into the Church without first agreeing to live by them. No one will be called to teach or to lead unless they accept them. When you want to go to the temple, you will be asked if you keep the Word of Wisdom. If you do not, you cannot go to the house of the Lord until you are fully worthy” (“The Word of Wisdom: The Principles and the Promise,” Ensign (Conference Edition), May 1996, p. 17).
The Bible does not ban the intake of hot drinks such as coffee. Even the idea (or the idea that hot drinks are bad) actually goes against scientific evidence. For example, consider this article that describes “25 Science-Backed Health Benefits of Coffee that you may not know.” If the Word of Wisdom is a “health code,” then how could coffee be shown to be beneficial? Also see here, here, and here, for example.
To see another article on this issue, click “Will the LDS Church ever overturn the ban on hot drinks?”