There are a few speculations on what exactly this verse means. St. Thomas Aquinas compiled gospel commentaries of Church fathers in the Catena Aurea. I have copied the relevant comments from the Catena below:
Raban.: It is to be noted, that the bench (tribunal) is the seat of the judge, the throne (solium) of the king, the chair (cathedra) of the master. In visions and dreams the wife of a Gentile understood what the Jews when awake would neither believe nor understand.
Jerome: Observe also that visions are often vouchsafed by God to the Gentiles, and that the confession of Pilate and his wife that the Lord was innocent is a testimony of the Gentile people.
Chrys.: But why did Pilate himself not see this vision? Because his
wife was more worthy; or because if Pilate had seen it, he would not
have had equal credit, or perhaps would not have told it; wherefore it
is provided by God that his wife should see it, and thus it be made
manifest to all. And she not merely sees it, but "suffers many things
because of him," so that sympathy with his wife would make the husband
more slack to put Him to death. And the time agreed well, for it was
the same night that she saw it.
Chrys., Hom. iii, in Caen. Dom.: Thus then the judge terrified through
his wife, and that he might not consent in the judgment to the
accusation of the Jews, himself endured judgment in the affliction of
his wife; the judge is judged, and tortured before he tortures.
Raban.: Or otherwise; The devil now at last understanding that he
should lose his trophies through Christ, as be had at the first
brought in [p. 942] death by a woman, so by a woman he would deliver
Christ out of the hands of His enemies, lest through His death he
should lose the sovereignty of death.
Chrys.: But none of the foregoing things moved Christ's enemies,
because envy had altogether blinded them, and of their own wickedness
they corrupt the people, for they "persuaded the people that they
should ask Barabbas, and destroy Jesus."
Gloss., non occ.: Pilate is said to make this answer, "Whether of the
twain will ye that I release unto you?" either to the message of his
wife, or the petition of the people, with whom it was a custom to ask
such release on the feast-day.