The story
The origin of such terms (e.g., shadow government, shadow cabinet, shadow minister, shadow portfolio) lies in the figurative metaphor of a shadow (shade) following its source object closely and in well-defined parallel. But conspiracy theorists have longed seized upon the way it sounds nefarious, as if it were meant to connote dark and sinister forces. This interpretation is also encouraged by disinformation purveyors seeking to sow societal disruption.
Etymology from Wiktionary, CC BY-SA 4.0.