Maybe McNamara goes out the revolving door of office sooner?
I'm not sure that would help much in the matter of MOL and Dynasoar; I believe MOL wasn't canceled OTL until the Nixon Administration, while Dynasoar was axed early on. In both cases there was some question just what the Air Force was doing with manned space projects. The policy, laid down in the late Eisenhower administration, that NASA was generally going to be responsible for humans in space on the theory that US space efforts were mostly peaceful (with unspoken reservations about orbital surveillance, which however was shifted over to the CIA and NSA, both out of DoD's chain of command) was not cast in concrete; the White House always reserved the option of military space missions--if the services could think of legitimate ones! That was the problem with DynaSoar; when it came to explaining why the spaceplane should be an Air Force project, the mission scenarios the Air Force came up with were all in some combination physically dubious (wait, now, you're going to enter the atmosphere, do your {fill in blank here} mission then aerodynamically turn around and skip back into orbit and return to base...I'd like to see the numbers on that!

) or politically far outside the policy box. Insofar as they had clearcut military roles it wasn't clear why unmanned missiles and surveillance satellites couldn't do the job cheaper and safer. MOL was a consolation prize McNamara was willing to tolerate (and did, until he left office) because it was less technically questionable and less destabilizing. (Manned surveillance may or may not have been cost-effective--probably not, especially in view of advances in technology not realized yet in the early '60s, but trying it out was part of the point, and surveillance in general was a capability each side would happily deny the other, but not at the cost of losing it themselves, and so was a lot less controversial than talking about orbital strike capabilities).
What I wish about DynaSoar was that NASA were more interested in exploring alternatives to the basic ballistic capsule for manned missions, and funded to develop them in parallel with the moon mission. It would have been very cool if they had something close to DynaSoar in operation by 1970. Space tech experts on this thread are dubious that such approaches would offer worthwhile advantages over ballistic capsules but again it would be nice to have tried it out and see rather than simply never go there.
The STS is a very different sort of deal; its liabilities overlap those of any spaceplane to some extent but it bothers me that in dismissing the wisdom of incrementally developing return vehicles with serious aerodynamic maneuvering abilities they often equate the STS with the whole spaceplane concept in general.
Getting back to getting rid of Mac--well, it was my heuristic starting point, but in fact both Kennedy and LBJ had a lot of confidence in him, clearly he was doing the job they wanted done, for good or ill. The policy of making NASA alone responsible for manned space operations seems like a sound one to me unless one comes up with a specific space mission for military astronauts and every one I've ever heard of either pretty much duplicates the NASA mission or is hare-brained IMHO, either because of questionable technical claims or because of very aggressive and destabilizing intents (putting actual weapons of any kind in space for instance, or devising suborbital bombers). We just come up empty with legitimate military missions in space that aren't a likely spark to set off Armageddon and that can't be done as well or better by NASA--if they can be done at all! (An example of a technically hare-brained scheme would be suborbital troop delivery--on a scale where rapid response to a nearby friendly stronghold landing point would be more than a PR stunt, the cost would be incredible, whereas sending a craft reentering from nearly orbital speeds directly into harm's way seems like a good way to get it destroyed and its human payload killed.)
So McNamara was only doing his job when he put the kibosh on USAF doing DynaSoar; a different Kennedy/Johnson SecDef would have done the same, and so probably would a Nixon appointee if he'd been elected in 1960 instead.
MOL however did survive quite a few budget cycles and was getting close to being operational when it was axed, perhaps it could make it. Part of the MOL package was to be Big Gemini, which might conceivably have been replaced by a DynaSoar type spaceplane as the manned capsule the crew rode up in and returned in. If that is NASA went ahead and developed it, and it turned out to have advantages worth the inevitable liabilities--as a NASA spacecraft, with no modifications to weaponize it, it wouldn't be so controversial.
So we might get both. But if we get DynaSoar at all it can't be for the military purposes the Air Force tried to sell it with.