[advertisement] !linguistics welcomes this sort of question [advertisement]
That said, look at Latin:
dexter - right side, but also: favourable, fitting, proper (cf Spanish diestro)
sinister - left side, but also: adverse, hostile, bad (cf Spanish siniestro)
The “privileges” that you see in derecho and right are an extension of what Latin already associated with dexter - things that are proper to do or to get. For example if I got a right to freedom, that means that it’s fitting for me to get freedom, you know?
Based on that odds are that Spanish simply inherited the association, and kept it as such even after borrowing izquierdo from Basque and shifting directus→derecho from “straight” to “right”. While English borrowed it, either from Latin or some Gallo-Romance language.
And overall you’ll see a fair bit of that in the Western European languages, regardless of phylogenetic association, since languages clustered near each other (i.e. a Sprachbund) will often borrow concepts and associations from either each other or from a common source.
Also, note that right “as side” and “as privilege” are not homonyms. Those aren’t different words from different sources, it’s the same word with two different meanings, this is called polysemy. The same applies to derecho.