There is no problem here.
Point 1. DC solenoids do not care which way that they are wired up. They throw the solenoid in the same direction regardless of current flow.
Point 2. The solenoid coil is just wire. If you put 12V permanently onto one side of it, and do not earth the other side of it, then the 12V will be measurable at both terminals. That 12V is actually measurable all the way down at the ECU. The ECU doesn't care. When the ECU decides that it wants that solenoid to operate, it provides the earth, by switching on a MOSFET (transistor) inside the ECU that will connect the solenoid terminal to earth (exactly as Duncan^ said). Now the solenoid has 12V being fed in one side and a convenient earth on the other side. Current flows, solenoidy things happen.