Looking at Annas and Sapphira.
It is not just they lied. It was their heart condition. They thought they could bribe God with their money. They must have been really wealthy to think they already gave so much and could keep a little back for themselves. They thought by copying what Barnabas did, in appearance they could have the same blessing.
But Peter asked them the $64 million dollar question. How is it that you agreed together to tempt the Spirit of the Lord?
The lesson in this is you cannot bribe God. All the people who sold their possessions where sharing what they sold with each other. it was not just...they gave it all to the apostles. It was every man. So why did annas and sapphira keep some back for themselves when it was all going to be shared anyway?
Later in book of Acts chapter 8 Simon the sorcerer tries to buy the holy spirit off Peter. What does Peter say?
Ananias and Sapphira had every right to keep all the money to themselves if they wanted. Their lie was that they gave the entire proceeds of their sale to the church.