Actually, the Bible provides little context of the life of Ananias and Sapphira. Only their choice to withhold some of the profits from the sale of possessions and lying about it are really detailed. What they were doing and saying that caused the issue to be brought before the church isn't stated, but there had to be something about their lives that made them stand out and brought them in for judgment in the first place. We just aren't told what that was.
Forgiveness was always an option for them. They could have admitted what they had done and asked forgiveness and God would have been fine with that. They willingly chose another course, not realizing what the consequences would be. That was true for both of them.
That's the problem with so many people in the world and throughout history. They live their own lives the way they want, assuming that when they get old they can make things right with God, assuming they even believe He exists. But the day of death isn't cast in stone. It can happen much earlier than we think it will - or we can be in an accident and end up in a coma or get a degenerative brain disease or have a stroke or any number of things that make it impossible to process thought and make things right before the actual end happens.
The Christians then, and Christians today in many countries, live at risk of unexpected death at the hands of man. Certainly the percentage of Christians at risk then was probably higher than it is now. Ananias and Sapphira made a choice, and they ended up dying early for it. I'm not sure that God expects anyone to be "perfect", even after salvation. But He does expect us to ask for forgiveness when the Holy Spirit convicts us. I'm sure the Holy Spirit was dealing with both of their hearts. It's one of the things He does. But the Bible also says that judgment starts in His own house. He expects more from His people.
Lying about what they had done was wrong. But so was whatever wasn't stated in the Bible about how they were living that brought them under scrutiny in the first place. That's likely the more major issue, not that one sin is worse than the other. And the important thing is, ALL sin separates us from God. It doesn't matter a bit what our opinion of the severity of the sin was. Both of these people had grown up in the Jewish culture and religion and would have been well aware of this fact. Throughout Jewish history, God was consistent. Merciful for a time as the people fell away from Him... and then He judged. I'm sure that throughout their history there were thousands and thousands who said what I was doing wasn't any different than what my parents or friends did - why did He have to stop our party now.
God was starting a new church and a new religion and wanted it started on a different and stronger basis, while still reminding the people that He hadn't changed and that sin was still sin. That church has had a lot of issues throughout time as various people have failed God. I'm sure some more Ananias and Sapphira moments would straighten some of that out. But God would be judged just as harshly for such actions if He did more immediate judgments today.