It is explainable in the context of divine foreknowledge and care for humans: as writes St. John Chrysostom, "God in His mercy, seeing beforehand that somebody, if given a longer life, will not use it for the benefit of his/her soul, but will remain unrepenting and fall into a greater depravity, stops this depravity by death of this person, in order to protect his/her immortal soul as less depraved as it is possible for its unrepenting condition".
Similarly, Peter, knowing through divine means, through the same divine Spirit, that the spouses would not repent, but rather fall into a greater depravity, and that the Spirit, Who out of love would not suffer this calamity on poor creatures, was going to take their physical life, just reported this divine love-full decision to them, also preparing in this manner them to receive it. In fact, God's love is not stopped by sins of sinners and He helps them even when they are not helping themselves through a sincere repentance. I
(Otherwise, if one does not interpret it in this way, will obtain an idiocy that Peter out of self will and self-initiated vindictiveness acted against the eternally and infinitely loving and life-giving Spirit and killed the poor spouses by his authoritative psychological attack: terrified them so intensely that their hearts broke and they died. If this was the case, then Peter himself would have been thousand times more malicious wretch then the poor Ananias and poor Saphira, and thousand times more worthy of death, within this idiotic (theo)-logic, than the latter persons.)
I agree that this Chrysostomian explanation leaves unanswered theological questions. But I would not go there for the time being.