The Pentagram did not start out as a religious symbol. Its origins are much more humble. Originally the pentagram was a simple pictogram dating back to about 3000 BC and meaning roughly "corner, angle, nook; a small room, cavity, hole; pitfall."(from Wikipedia)
From these humble beginnings the pentagram evolved. The Pythagoreans were the first to attribute the pentagram with the five elements, though they used idea instead of spirit. This idea continued and was expanded to be used magically in European occultism. It was not until the mid 19th century that the idea of evil was first associated with the pentagram. The writer Eliphas Levi was the first to say that an inverted (upside down) pentagram was evil. When inverted the pentagram was thought to symbolize the triumph of matter over spirit and this was considered a bad thing. However, when turned right side up (as depicted in the graphic above) spirit triumphs over matter and this was considered "good".
A little known fact about the pentagram is that it was in use as a Christian symbol also until sometime in the twentieth century when it was rejected due to a misunderstanding of it's symbolism. In Christianity the pentagram was used to represent the five wounds of Christ as well as several other things and was thought to offer protection from witches and demons.
The common misconception of the pentagram being evil comes from the usage in Satanism of the inverted pentagram or as it is called by Satanists, the Sigil of Baphomet. This sigil is typically drawn in a double circle with the head of a goat inside the pentagram. The three downward points show Satanists rejection of the Holy Trinity.
The pentagram now is most commonly a neopagan symbol, especially used by Wiccans as a sign of our faith. The points represent the five elements (as depicted above) and it is typically surrounded by a circle which represents the god/goddess that binds us together.
The pentagram has many associations that I may explore more in depth at a later date but this is it's basic history. I hope that you have found this post informative and that it has helped to dispel some of the misconceptions associated with the pentagram.