The centre-back was shown two yellow cards as Madrid suffered a 2-1 defeat at Santiago Bernabeu , ending their eight-game unbeaten run in all competitions.
Ramos was penalised for a hand ball in the box in the second half, allowing Girona to draw level from the penalty spot through Crhistian Stuani.
The Spain international was then handed his marching orders in the final minute when he appeared to catch the visitors' defender Pedro Alcala as he attempted an overhead kick.
It is the 20th time in his career that the 32-year-old has been sent off in the Spanish top flight - the next highest is 18 - and the 14th in which he has been dismissed with a second caution, though one of those was retrospectively rescinded.
Overall, he has been given 146 bookings in his 454 La Liga games – a rate of about one in every three matches.
The latest red card comes just days after the defender landed himself in trouble with UEFA for his yellow card against Ajax.
Ramos admitted after the game that he had committed a foul with the intention of getting booked in the first-leg of the Champions League last-16 tie. Although he will miss the return fixture in the Spanish capital, it ensures he will available for the quarter-finals should they preserve their 2-1 advantage over the Amsterdam side.
He soon backtracked on those statements, however, after European football’s governing body announced it has opened a disciplinary investigation into the matter .
He then told Marca : "I'm very surprised by all of this. I meant to force the foul, a foul that was inevitable; not to force the suspension."
In a similar vein, the suspension he will serve for his sending off against Girona means he will be back in time for Madrid’s La Liga encounter with league leaders Barcelona on March 2.