IIRC Sony allowed Linux to be ran on both the PS2 and PS3 so that they could sell the systems as computers in the US instead of video game consoles, since computers have a lower import tax rate compared fo video game systems.
This was, of course, until Sony removed OtherOS support in the PS3 firmware 3.21 on phat models after shipping Slim units without OtherOS and then got sued for it. It was removed because George Hotz found an exploit in OtherOS that allowed for full access to the hardware, as OtherOS did not have full access to the GPU hardware of the PS3. Ironically, this made the PS3 more of a target to hackers, since hackers generally just want to be able to run homebrew on their devices that they bought. This is why the Xbox One and Series consoles were never hacked, since they allow for homebrew via DevMode.