I see a lot of organ accompaniments to Gregorian chants, eg Attende Domine or something from a Kyriale, starting and ending on another chord than the tonic/finalis. A phrygian melody might have the finalis on the note E but end on chord A. Why is this?
This is quite common with Phrygian melodies, because the half step between the finalis and the note above means that it is impossible to harmonize a descending melodic cadence with a V-i progression without chromatic alteration of the melody, which of course robs the melody of its modal identity.
The other three modes, by contrast, support the V-i or V-I cadential progression with no chromatic alteration or with that alteration in other voices: Dorian is the basis of the minor tonality while Lydian and Mixolydian are the bases of the major.
If one applies the rules of tonal harmony to a Phrygian melodic cadence while ending on a chord rooted on the finalis, one ends up with a cadence that sounds like it's ending on the dominant without resolving, and some baroque settings of Phrygian melodies do just that. Others end with the finalis as the third of a major chord (many of Bach's settings of the passion chorale do this) or, as you've noted, as the fifth of (what would normally be) a minor chord (but may have a picardy third).
Chants were not composed with chordal accompaniment in mind. Any such accompaniment doesn't fit too well. At best, one can try to fit chords using good voice leading practices. The modes used in chant classification are melodically derived so most modern jazz-and-pop-oriented techniques (harmonic) are not that useful. Of course, the performance of chant itself is still problematical. The best one can say is the modern arrangers have to do what sounds good. There are some websites, however, these often seem a bit polemical so one should check out several. https://www.ccwatershed.org/2013/08/17/essay-gregorian-accompaniment/ https://forum.musicasacra.com/forum/discussion/853/chant-accompaniment-best-practices/p1 https://urresearch.rochester.edu/institutionalPublicationPublicView.action?institutionalItemId=5008
Some modal chants are treated by the Baroque composer like they were major or minor, so they become adapted or transformed to another gender of tonality (e.g. chorals by Bach).
A phrygian melody might have the finalis on the note E but end on chord A. Why is this?
As you may know there are authentic and plagal modes: Plagal modes have the same root tone (finalis) as the authentic mode but another range
How do you identify that this was the Phrygian mode?
Maybe your analyses are wrong because you didn't respect the hypo modes:
The melody can begin with E but the finalis is A = hypo-aeolian and not phrygian.
Look up this answer to another question related to yours:
According to Spencer each plagal mode and its harmonizations' were "ruled" by the modes corresponding authentic scale. For instance while Hypo-Dorian would start a fourth below the opening tone of D it would follow the structure of the Authentic Dorian mode when harmonizing. This is why the Hypo-Mixolydian although structurally identical to Dorian is different since its harmonies would be ruled by the Mixolydian mode and its corresponding scale.