Which one got it right?

In my opinion, they're both the same.

Hyun Bin is a far better actor than the other leads though.

Both are bad. W was just a boring modern romantic cliche fairy tale. It had an interesting premise, but every other aspect of the show was so shallow and the story was overextended.

Alhambra is mostly the same. It has a very cool premise and technically it's a fantastic effort regarding sound and visuals, but the story drags too much, characters are not compelling and the romance aspect is absolutely unnecessary.

I do agree that the main lead is probably better than in W. And while W was dropped by me after few episodes, i at least want to see where the plot takes Alhambra. So i guess Alhambra is a bit better in my opinion.

If there is a need for some entertaining sci-fi/fantasy drama with a bit of romance, there is an older japanese drama Ando Lloyd. It's pretty cheesy and ridiculous, but it's much better paced and doesn't even try to mask its shortcomings, but mainly focuses on fun and action spectacle.
https://mydramalist.com/7942-ando-lloyd-a.i.-knows-love-

Memories of the Alhambra to me was like watching a fail video-game plot having a live action (or sort of). The only thing I always got myself doing was changing the channel. In the other hand, W was a big hit and well played. Nothing against any actors, productions etc, just didn't work in my point of view nor got my interest at all.

I dropped W: Two Worlds because I just couldn't watch any more twists I just gave up lol. I think the romance was good, the chemistry was certainly there but I don't even know where they are going anymore. I finished Memories of the Alhambra maybe because it was a proper game and there's a clear end goal (even though im not so sure if the ending was as clear as i thought it would be). I also felt super invested in Hyun Bin's character and Park Shinhye's brother. I loved the whole story on the brother and his friend and was rooting for park shin hye's family to be together again.

Both dramas have wonderful actors. But, both the dramas lacks justifying reason for their ending.

I watched both since, they have a different plot at least from what I saw...

But, they failed to give a reason or justification for why they happened...

In one scene, they gave some reason and show something and in another scene it differs to the principle they told. It's lacking to involve in those dramas.

well for me, both had a interesting start and kinda started to bore towards the end!!!
if i had choose between these two , i would choose Memories of Alhambra.
surely both doesn't have strong story... MOA was much better than W, Towards the end W made no sense at all, and it lagged like hell!