Assuming that your son's girlfriend has a British or other EU passport there's no problem.
EU law requires all member states to admit any EU citizen as long as they can produce a valid passport (or national ID card). Even if your son's girlfriend arrived at the Spanish immigration desk with just a few seconds left on her passport, the Spanish authorities would be obliged to let her into the country.
However, if she renewed her passport now the new one would run until September 2019, ie the unused time would be added to the new passport. So if she did that the problem wouldn't arise.