I believe the Maria ending has a bad reputation it does not necessarily deserve. Most fans seem to be in consensus that if this game has a truly negative ending, this is the one. I used to think so, myself, but lately I've come to believe that it may not be any better or worse than the others, and that it may not be anywhere near as damning an indictment of James' character as people seem to think.
A lot of what gives people an unfavorable impression of this ending is Mary's reaction near the end of the game. She is bitter and angry at James, and becomes the monster in the same way Maria does in all other versions of this same scenario. Naturally, James is forced to kill her (again, as the case happens to be). Given what the other scenarios teach us, this alone is enough to paint 'douchebag' on James with broad strokes of the brush. The implication is that he really did want Mary dead and feels little, if any, remorse for having brought about that result with his own two hands and a little help from a pillow pet. The reason James favors Maria is because he views Maria as a better alternative, perhaps because of that good ol' Silent Hill fan standby: she's a more willing and adventurous boner receptacle and that's all he really wants in life.
I do not intend to suggest that this James is a completely nice guy who has done nothing to earn his bad reputation. I think he has, potentially, done wrong to earn this scenario. I also happen to believe that it is not a wrong for which he deserves the blame he gets.
The primary factor in determining whether or not you achieve the Maria ending is your interactions with her. The more attentive you are, the likelier you are to end up with it. This seems to be misconstrued as James focusing on Maria when he should be paying attention to finding Mary. Really, though, how fair is that attitude? Maria plays upon James' emotions like an instrument. She resembles Mary, and though she has a tendency to twist him in knots at times, she's not doing this with malicious intent--she's merely programmed to act this way. What we're doing, as fans, is punishing James for acting in a way most of us would act in his shoes: we encounter a woman who appears to be lonely, frightened and helpless. It is a completely acceptable reaction to become protective of her, since we have the means to do so. Compared to the scant few other people James encounters, Maria comes across as more enigmatic, but less crazy and unpleasant. She does bear a resemblance to Mary, though she does initially deny any connection. She is afraid to be alone and wants James to protect her.
So, why is he a bad guy for doing it?
Even if this is the path down which James travels, he never seems to behave in such a fashion that should give people the impression that he's doing it simply because she looks like an easy lay. Even if he protects her, he reacts to her flirting and cajoling no differently than if he outright ignores her for the sake of the mission. It clearly makes him uncomfortable, and he does not sound even slightly eager to cash in on her implied promise of sexual favors when she offers them. Clearly, to me, he's not thinking with the wrong head when he decides to be her bodyguard.
I think there are a combination of reasons he might choose to protect Maria, and primary among them is a sense of guilt that he did so little to comfort Mary when she needed him the most. By staying close to Maria and keeping her from being harmed, he is attempting to redeem himself for having been negligent and selfish regarding his terminally-ill wife. It is, perhaps, too little, too late, but that does not, in itself, color the effort in negative shades. One might construe it as selfishness, since he may be doing it primarily for his own sake, but that would not account for the honest anguish he feels when he ultimately fails to keep her alive. I think the reality of this situation is that there is altruism mixed with self-interest.
I also think that this James is a man who has not been able to completely shake himself of the negative impressions he has formed of his wife as her ability to control her own emotions began to break down. This leads a lot of people to assume that he hates his wife, as he claims to have done, but I don't think it was ever anything like real hatred. Closer to the truth, I think, is that he was truly hurt by her outbursts, and that his crime was being unable to understand that she did not truly mean what she said and consequently, he could not forgive her for saying them. I think this is why, at the end of this scenario, the 'demon' appears to him truly in Mary's form and attacks him--it is a manifestation of this impression he has been unable to shake. In a sense, this is his way of shaking it, but since he seems unable to do this by separating his perception from the reality of her situation. This does not make him hateful or wicked, just very flawed.
In other words, it was something he had to put behind him.MARIA: You killed Mary again?
JAMES: That wasn't Mary. Mary's gone. That was just something I...Maria?...Maria?
So, we end up with a man for whom life offers nothing, but neither is he willing to die. Perhaps under normal circumstances, he might have chosen one option or the other--a miserable life which would probably lead to him never being able to move on and probably losing his mind in the end, or a quick death to make it all not matter anymore. However, Silent Hill and the Otherworld has been offering him a third option all along, and the Maria ending is James choosing that third option: a replacement for Mary. Not only does he not have to face life alone (or forfeit it altogether), he has what might be, to his way of thinking, an idealized form of Mary, as she herself indicates in other scenarios (I'll never make you feel bad, I'll always be here for you, etc.).
There are two implications left at the end of this scene. One is that they actually leave town together. This, I do no believe actually happens. I believe that they remain in the Otherworld for the duration of whatever their future happens to be. Perhaps it changes, to James' perspective, to simulate something closer to the real world for him--it is now a place in which he can be happy (similar to how the patient described in the Doctor's Journal is submerged in the Otherworld and finds happiness there). There is also the implication that his happiness may be short-lived, revealed by way of her Cough of Impending Death. This leads to speculation that he might have to do it all over again. Whether or not this is true is speculation for another day.
To sum, the Maria ending is the the conclusion of a story in which James is a flawed man who did still love his wife, but never managed to reconcile that love with the resentment he felt towards her abusive outbursts. Perhaps, and perhaps not, some of that resentment is the unfair "this situation ruined everything, FML", but though he does acknowledge this, even in this ending, it's never really spoken as though it was of overriding importance. I think, if there was resentment there, it was the kind he was able to identify and quell, because it was beyond her ability to control. Her anger and hot words, on the other hand, were things he could not so easily forgive. Like with the other endings, I think the Maria ending offers an intertwined promise and peril in that the outcome can be positive or negative, and we're left to wonder (and assume) which ends up being the case. Most, of course, assume that the outcome will not ultimately be happy. I think there's a chance it could be so, if for no reason than that he has had the opportunity to see what he did wrong, and behave differently if the situation arose again. Who knows? The Otherworld does allow for strange things, after all.