Thomas Hardy's "After the Visit" in a beautiful and interesting poem. It is made up of six stanza, a total of twenty-four lines, and its rhyme scheme is abba, abba, etc.
In order to best understand the meaning of the last stanza, I found it necessary to try to understand what Hardy had been saying throughout the whole poem, especially in the fifth stanza because the thought of the sixth stanza is a continuation of a sentence (and thought) that starts in the fifth stanza.
The title "After the Visit" makes me wonder if the entire poem is not about a ghost, for the fourth stanza alludes to a ghost, and sometimes when ghosts are allegedly seen, it is called a visitation.
Starting in the fourth stanza, the speaker notes that he thought "she" might be like the "phantom" that is said to walk the "ancient floors," until she stepped from the shade and he saw her "living eyes" which looked at him with an "inquiring" gaze of a soul that thought about (almost unconsciously) the "eternal question" of "What is life," and "why are we here," and finally, whose laws decided that what matters most in life, cannot be?
Poetry is specific to the person who reads it, in that each person brings something different—based on personal experiences—to that reading of a poem. Now that I have a sense of the last three stanzas, I can imagine what Hardy might be writing about: but these are just my impressions.
If the speaker is addressing a ghost, the question at the end might be directed to the "strange laws" that keep the speaker and the woman he sees apart, separated by life and death.
The closing stanza could simply refer to a man and a woman who care for each other, but who are separated by age, marital status, social standing, or some other extenuating circumstance where being together ("what matters most") cannot be.
The entire poem seems to share images of the past, whether dealing with a living person or a ghost. (Hardy's reference to "living eyes" might refer simply to a fire or glow within the eyes, present under any circumstance: it need not be literal—it's a poem.) He speaks to a woman, saying at the start of the first two stanzas, "Come again..."
It would seem that time has passed and the speaker hasn't really noticed it:
...the bordering flowers swam unheeded away,
And I marked not the charm in the changes of day
As the cloud-colours came and went.
When "she" travels down the dark corridor and comes out of the shade, her eyes simply seem to unconsciously ponder questions that have been asked through the ages, looking for understanding, and finding perhaps bewilderment or disappointment that whoever is in charge of "life," or governs us, keeps us from things are not meant to be or can never be.
My last thought is that Harding wrote poetry more toward the end of his writing career. He also lost his wife in 1912. This could be a poem he wrote after Emma's death. Additionally, Harding lost touch with his faith and could not seem to get it back, or cared not to even try: "by those strange laws / That which mattered most could not be" may also refer to his lost faith in God, referring instead to a mysterious power that chooses to make decisions for us in life where we are left with a sense of futility as to why that power chose a particular path for us—as if there were no rhyme or reason to those decisions made in our lives.
These are my perceptions. I hope they are of some help.