That is an interesting question. The original refernece to the number 666 being the "mark of the Beast" comes from the Revelation of John. It use to be commonly believed that this was John the Apostile, but it is now believed to have been written by John of Patmos in the First Century CE. It is not clear as to whether or not John actually met Jesus, or if he was a member of one of the early churches. This is the source of the connection of the number 666 to evil.
Numerically, 666 is the numeric value of "Ommo Satan", the "Evil triad of Satan- Typhon, Apophras and Besz", which is the evil triad in some early Christian and Gnostic literature. This is probably where John of Patmos got his inspiration. It is also the numeric value of Nashimiron, the Qlippoth (or demonic entity) of Pisces. However, it is also the number of Sorath, the spirit of Sun. It is also the number of the phrase "Shem Yeheshuah" which means "The name Jesus". According to Qabalistic theory, words that have the same numerical value have a relationship to one another.