OMG not this again! Insomniac
chose Spider-Man from Marvel's complete roster; it had
nothing to do with Sony owning gaming rights which they don't own. Marvel approached Sony to make a Marvel hero game. Sony gave the job to Insomniac. Insomniac chose SM (for obvious reasons). But licensing deals has nothing to do with this title and it could have been a Hulk or Iron Man game...
gamingbolt.com
Additionally, that was the agreement to make Marvel titles before SM was decided upon. Again, as above, Marvel went to Sony (and MS) and asked for a AAA company to make high-tier games for them. Sony agreed. Sony approached Insomniac and said, "what do you want to make?" Price chose SM. Sony developed the game in agreement with Marvel for a new AAA Marvel-IP title.
(This is actually contradicted in the quoted source that says Sony chose SM and approached Insomniac to make it. That isn't supported by the quotes though and seems to be inferred by the author.)
This is all completely independent of Sony's movie rights and Sony have zero game licensing deal for the SM IP as far as we know (and we would know because it'd be a big deal broadcast to investors). Subsequent PS exclusives are either one-off agreements or good-faith agreements - there's no financial record of Sony securing rights. And evidence like PS exclusive SM skins for Fortnite are shown to no longer be valid with the latest cross-platform SM skins. The previous Fortnite exclusive skin was a Tom Holland movie tie-in, not a Marvel/SM creation.