They played badly in that match and there really was no reason other than that, especially with those who were always disorganized in guarding the defense and always letting Girona's players in without real guard, it was a pretty fatal mistake.
Atlético's chance to reduce the gap at the moment is quite doable but don't underestimate Mallorca too much because indeed they are also in pretty good confidence after their 2 consecutive wins.
Conceding four goals from a team like Girona is not a natural thing for Real Madrid, Ancelotti as a coach must see this as a problem that needs to be fixed immediately. After facing Almeria and Real Sociedad in La Liga, Real Madrid will face Osasuna in the Copa Del Rey final and three days later will face Manchester City in the UCL. Defense must be the main focus in important matches to prevent conceding many goals like against Girona.