score:2
Based on what you say, my interpretation is that what your friend has/had is not a visa, but a Leave to Enter issued at the border when he arrived without a visa. Visas for the UK are always be applied for in advance.
(The word "leave" is here used in the slightly archaic meaning of "permission").
Your friend's first Leave to Enter automatically lapsed when he left the Common Travel Area. Its 6-month duration is not relevant anymore.
He successfully applied for a new Leave to Enter when he returned from Spain. Its duration governs how long he can stay in the UK now without overstaying.
Beware, however: If he told the immigration officer at the border that he would stay for less than 6 months then he should stick to what he told. If he changes his plans and stays longer than he said he would, even though it is legal for him to do so, it can create problems for him on later visits. The next time he tries to enter the UK, he may be questioned about what caused him to change his plans, and refused entry if they don't like his answers. We have seen several concrete cases of people who were refused for this reason.