This is one of the most painful questions that lands in this archive, and it deserves a straight answer rather than a diplomatic one.
There are two kinds of men, and incarceration does not change which kind someone is. It reveals it.
A man who was faithful, grateful, and genuinely invested in his relationship before he went in will come out of that experience with a deeper appreciation for the person who stood by him. He knows what it cost you. He knows you kept the phone on, put money on his books, showed up to visitation, wrote letters, stayed loyal when you had every reason not to. That kind of man comes home and holds onto you tighter than before.
The other kind uses the support you provide as a resource while he is inside and discards it once he no longer needs it. The calls, the money, the loyalty, all of it served a function during the sentence. When the sentence ends and the outside world opens back up, so do his options, and the person who sacrificed the most to keep him comfortable is sometimes the first one he walks away from. There is no clean explanation for why this happens so consistently, but it does happen, and it happens enough that people who have spent time inside have watched it play out over and over.
Here is the honest part. You already know which kind of man you are with. You knew before you sent the first letter. The question is whether you have been honest with yourself about that answer or whether hope has been doing the work that clarity should be doing.
Loyalty given to the right person is never wasted. Loyalty given to someone who was never going to honor it is a different kind of loss entirely, and only you can decide how long you are willing to carry it.