A very good remark! May I ask how you knew Carmen is a woman?
Carmen is, as I am sure you noticed, an exceptional woman name in Romanian, one of the few if not the single one that doesn't end in the letter a. Because of that we use lui as if it were a male name.
On the other hand, we have a male name ending in an a, Mircea, for which we also use lui because we know he's a male.
I hqve no idea in romanian, but in spanish there are a few names that can be used for both genders: Guadalupe (mostly in México), Carmen, Refugio, Consuelo (very rare, but exists)...
And some foreing names for men, are used for women in spanish: Jesse (english) and Michell (french).
I've never met or heard of a male Spanish native speaker with the name Guadalupe, Refugio or Consuelo. Do you remember which nationalities have those men? It could be a question of different countries and your comment sounds very intriguing to me. :-) I know for a fact that Rosario and Andrea are male names in Italian, while in Spanish these have been always female names.
I may be wrong here, but I think that if you consider Carmen to be a foreign female name (like Anna), then you would say "lui Carmen" just as you would say "lui Anna." However, if Carmen is Romanian, then I don't think this would be correct, just as you wouldn't say "lui Ana" (for the Romanian name Ana as opposed to the foreign name Anna) but rather "Anei." Feel free to correct me if I'm wrong, since I'm still struggling with this whole genitive thing.
Since Carmen is accepted as a Romanian name, it wouldn't be treated like a foreign name when speaking Romanian. However, in Romanian, female names that do not end in a vowel are treated like male names when forming the Genitive, by putting "lui" before the name.
See also: https://forum.duolingo.com/comment/19992906