I should say I no fan of mourinho he spent enough money and when he didn't get what he wanted he spat his dummy out.
Pep on the other hand spends whatever he wants on defenders till eventually one sticks with very little criticism compared to others.
He joined the club with the following defenders: Sagna, Zabaleta, Kompany, Otamendi, Mangala, Clichy, Kolarov. All of whom were either old, injury prone, shit or a combination of the above.
In his first season he signed Stones as a young player who would initially be one of three decent centre back options (so Kompany’s injury issues wouldn’t be so much of a problem) but also as an eventual leader of the defence and probable captain. He stuck with the full backs he had but they were all on the decline and an obvious weakness.
Zabaleta, Clichy and Sagna’s contracts all expired at the end of 2016-17 and Kolarov went back to Italy so obviously new full backs were needed. He got Walker in as first choice right back who was obviously a massive success. Mendy was intended to be the equivalent on the left but had massive injury issues. Danilo was signed to cover both full back positions but with Mendy out City (it seemed) were suddenly left without any rotation options at full back. The signing of Laporte as Stones’ long term centre back partner was then brought forward to the winter transfer window as he could cover at left back as well as centre back. However, Delph ended up doing so well filling in at LB and Stones struggled with injuries so Laporte ended up becoming a first choice centre back.
In 2018-19, Guardiola stuck with the same group of defenders, rotating Otamendi, Laporte, Kompany and Stones, with Walker and Mendy again intended to be the first choice full backs. Mendy broke down again early in the season so Delph and Zinchenko ended up sharing the LB spot, (with Delph being less reliable than the previous season). Like the previous season, City finished with a brilliant defensive record and won the league.
Summer 2019 was where it went wrong. Kompany and was allowed to leave to see out his career in Belgium. Delph was also sold, along with Danilo (in a part swap with Cancelo). Laporte then got injured in the autumn and missed almost the entire season, while Stones went into a massive rut and completely lost his mojo due to issues in his personal life. This left an ageing Otamendi as the only senior centre back at the club with Fernandino filling in beside him (meaning the team had also lost its sole midfield defensive shield). Mendy also returned but was no longer the player he had been before the injury so basically City played the entire season with a patched up back four which went about as well as it is for Liverpool now.
So now we move on to this season and you have Otamendi departing and Nathan Aké signed as both his replacement as cover for the first choice centre backs and in the problem left back position. Dias is also signed as the long term replacement for Kompany. Stones has been written off and is for sale. However, it becomes clear that Eric García (who graduated from the youth team the previous season) intends to leave for Barcelona so Stones is retained as an extra centre back option.
Then, through a degree of luck and some tactical evolution, it all clicks into place. Aké and García pick up injuries and Laporte doesn’t return to his pre-ACL form so Stones is given a chance next to Dias and the two become the best partnership in the league. Walker gets COVID and Cancelo (who had been much improved at left back) moves back to right back and looks world class. Mendy wastes his last chance under Guardiola so Zinchenko returns to the side from the wilderness and is his typically quiet 7/10 every week at left back. City now have the best defensive record in the league by far, making it three seasons out of four where they’ve had excellent defensice records.
TLDR: Pretty much all Guardiola’s defensive spending has been absolutely necessary and all but one major signing has been a success (and even that has clear mitigating circumstances). They’ve also been excellent defensively ever since Guardiola has been able to build his own defence, with the only season where they were weak defensively being the one where they lost their two main centre backs without signing a replacement and had to use their midfield anchor in defence leaving a huge hole in front of their patched up back four.