I also think that the reason why the wife’s remarks to Pilate were included was they were to remind us of another wife who tempted her husband. That woman was tempted by the Devil via the snake. I believe that the dream was a temptation given by the Devil in an attempt to ruin God’s plan of salvation.
Not a Bible scholar, but that’s how I see it.
Or what about Herodias? She had no faith at all, only desiring revenge.