There's a ton of history on this. Both houses started working on plans they could get behind...(both from house originated bills. What the Senate did was take a bill and modify the heck out of it. It's their right.)
Although all bills originate in the House, they don't always end up being what they started out as. lol. That, unfortunately, isn't uncommon with riders and "pork" getting attached all the time. But the senate needs something to work with so they "picked one" and modified it. This was a parallel effort going on in the house and senate. Of course, whatever they came up with would have to go back to the house again, modified.
So knock off the "It wasn't created legally" propaganda. Do you really think the American people are so stupid that if you just keep saying this stuff, we'll eventually believe it? Come on. It even passed a Supreme Court check-over. All of it passed muster except for the mandatory medicaid expansion. That was left up to the states. Good luck red states.
Here's the blow-by-blow according to wikipedia
Patient Protection and Affordable Care Act - Wikipedia, the free encyclopedia