One of the two women had demanded to be recognized as the mother of the girls although it was her partner that actually given birth and was listed as the biological mother.
The women said that both she and her partner has signed the consent form for artificial insemination and were therefore both parents of the child.
The Supreme Court decided to grant both women maternity, in what was the first-ever case of its kind heard by the institution.
In its ruling, the court stressed the child's best interests were always paramount and that family stability was key.
The decision upheld an earlier ruling made by a provincial court in Santa Cruz de Tenerife in the Canary Islands.
The twin girls involved in the case were born in December 2007, with the biological mother being listed as the only parent at the time.
After the couple's divorce, the biological mother argued she was the only partner entitled to maternity rights.