Definitely not altruistic. The Pixel phone was always a defensive position, not Google's profit center.
From the position of Apple, the Google Pixel was always a poison in the profit pool so that the monopoly would be held in a different part of the value chain (the Search versus the Hardware). In this regard, Apple's loss is the consumers' gain.
By making the Pixel really repairable and parts exchangeable, the Pixel can be shown as a shining beacon of right-to-repair. Techies will applaud how great it is, and have an object to contrast the iPhone with.
However, if the iPhone is forced to go the same path via right-to-repair laws (or due to consumer sentiment), their profits will be a lot lower. People won't need to replace iPhones as much. They couldn't price discriminate using different size SSD drives as much, etc.
And that's the whole game to Google -- again to reduce the hardware part of the profit chain, and to increase the search part of the profit chain. It's basic MBA stuff / Michael Porter's 5 Forces.