There is no such thing as a perfect church. I think we all know this. There are only imperfect churches who worship a perfect God. The church is and always has been a community of flawed individuals who are saved by the grace of God. This has been the case since the birth of the Church at Pentecost. The first church was a growing church, it was a vibrant and Spirit-filled church. In all honesty it was probably the closest to perfect than any church in the history of the Church. But, it had flaws, it had problems and yes, they dealt with sin issues among the body of believers. We should take comfort in knowing that even the first Church was defective and dysfunctional because God worked mightily among this rag tag group of Christ followers then and he can work mightily among His people today.
One of the strong attributes of the early church was that it was a church that shared and gave. The author, Luke, reports that they had all things in common and they shared their possessions as needed. They had an attitude of giving and this attitude was infectious. People were selflessly sharing their possession, and they were meeting needs of those less fortunate. To show and example of the generosity of the church Luke tells us a story about Barnabas. He was a man who had some land and for whatever reason sold it and gave all the money to the church. He gave with an open and generous heart, he held back nothing. He wasn't looking for public praise or approval; he wanted to be a blessing to the church and gave as act of worship to God.
His story of generosity became public and a couple named Ananias and Sapphira heard this story and decided they would do the same. The unfortunate thing is that their motives weren't pure as Barnabas's were. They sold some possessions and decided to keep some of the money for themselves. The words "kept back", in verse 2 literally means to steal, embezzle or withdraw covertly to ones own use. This was a full on act of decption. They brought the money and laid it at the Apostles feet in hopes of receiving the same positive acknowledgement and praise that Barnabas received. They lied to the Apostles by telling them that they were giving them all the money and keeping none for themselves. The Apostle Peter catches them red handed and confronts them of their deception to God. The end result is quite disturbing as both Ananias and Sapphira are struck dead for their sinful deception.
So the act of keeping some of the money for themselves was not the sin that they lost their lives over. The act of deceiving God is. The punishment still seems a bit harsh but I think the author is trying to prove the point that God will not tolerate deception that leads to dishonoring His name (Read Proverbs 6:16 - 19).
Ultimately I think it is important to know that the early church did not deal lightly with sin. They could not allow this movement of God to start with corruption and deceit. Ajith Fernando writes in his commentary on Acts, "If there is true fellowship in a Christian community, then when sin appears in the body, it will be confronted. If we feel someone is lying, we must question him or her about it... If sin is not dealt with decisively the chances of healing for the one who has sinned is greatly reduced."