A Spanish matador is recovering in hospital after he was gored in the groin during a bullfight in front of hundreds of spectators in Madrid.