Satan is an interesting topic. The Bible's account of him and his origins are split up in several places thought the whole Bible. As others have said, Satan was the top angel, but rebelled against God (don't really know why, but some have suggested the plan to create Humanity is the reason), God casted him out of heaven. Satan fell to earth and established a kingdom here. Since the Creation of man, he has sought to destroy God's relationship with Man. Don't know really why, but I guess it is out of spite.
Now Farmer Dave asked a very loaded question, "Why did God create him if he was to become a rebel?" The same question can be asked of humanity, the Israelites, and Christians. The key thing to realize is that God wants to be loved. He wants relationships. Thus he made the very dangerous choice of giving free will to his creation. Without free will there can be no true love, no true relationships. In that single choice he gave the possibility of sin, evil, and separation. Yet, he also gave the possibility of love, glory, and relationships. Unfortunately, sin did enter into creation. Evil did rise up. These were the consequences of creating beings that are capable of love. God didn't want mindless droids who were forced to love and glorify God. God doesn't want to force people (or angels) to love him. He wants to be able to call out to them in love, and them respond. Sometimes that love is rejected.
Well I'll stop now before I go in circles any more. Like I said, the question of why God granted us Free Will, and why he has allowed evil to enter into the world is a question deep in controversy, theology, and emotion. So finding an exact answer is probably never going to happen, but will remain one of those little mysteries.