The "ghosts" were the Cybermen trying to instantiate themselves in the world, but where did Torchwood get the lever that controlled the ghost shifts? Why were they running the shifts?
As to "why" they were running the shifts, the answer is in the show. They were trying to create a disruption at a known point of dimensional instability (e.g. where the Void Ship emerged) in order to harness the energy they detected.
DOCTOR: So, you find the breach, probe it, the sphere comes through six hundred feet above London, bam. It leaves a hole in the fabric of reality. And that hole, you think, oh, shall we leave it alone? Shall we back off? Shall we play it safe? Nah, you think let's make it bigger!
YVONNE: It's a massive source of energy. If we can harness that power, we need never depend on the Middle East again. Britain will become truly independent. Look, you can see for yourself. Next Ghost Shift's in two minutes.
As to "where" they got the lever, there's no canon explantion but it's quire reasonable to presume that they built it themselves out of the various components they've salvaged from the numerous alien invasions that have happened over the years.
Torchwood is a research organization. They detected an invisible breach in the universe (through which the Void Ship came) which was the source of Ghost Energy and build their building around it.
Torchwood then tried to open that breach to harness that ghost energy. The attempt resulted in Ghost Shifts.