First off, maybe this isn't actually true, in which case I would like to be corrected. But assuming putting nukes in orbit actually was the goal of the space program(s), why didn't either the US or the USSR actually do so?
We both demonstrated a great deal of capability in spaceflight. Were there some technological/implementational barriers, or did the goals change over time? Was that actually never a goal?
I'm not sure where you heard that. I mean, the space race was always dual-use — you can use a rocket to put a satellite into orbit, or a nuke onto another country. There were some ideas, from early on, about how you would weaponize space, both with nuclear and non-nuclear weapons. But it isn't anything fancy to put a nuclear weapon into orbit, in and of itself. There were ideas about developing "weapons platforms" but they were never the main reason that the US or USSR were interesting in going into space. From a strategic point of view, there are many disadvantages to putting weapons permanently into orbit, as opposed to just keeping them on the ground (where you have physical control over them) and launching when needed.
As for why space remained weapon-free, it's because of the Outer Space Treaty of 1967. It very clearly prohibits all militarization of space, especially with nuclear weapons.