There were several factors at play, both domestically in the USA, as well as in the way the USSR ran their space ops. Keep in mind that whole books have been written about this topic, so I will admittedly keep things pretty brief and grossly simplistic here, and no doubt leave some stuff out.
Firstly, if we just focus on the Soviet success of Sputnik 1 - the USA had the means available to beat the USSR to be the first to orbit a satellite. In fact, many considered it a foregone conclusion that America would be the first to put a satellite "on orbit". American intel knew of the Soviet plans, but did not believe the USSR was as far along as they were in their booster development (focusing on their modified R-7 Semyorka booster that put Sputnik 1 on orbit here). In-fighting within the US military and political apparatus however resulted in America trying, and failing, to use their Navy Vanguard launch system to beat the Soviets to space. The Eisenhower administration was largely to blame there, as they wanted to back and focus on the Vanguard booster as their means of putting the first satellite up to commemorate and meet the goal set forth for their International Geophysical Year contributions to space science, largely because Vanguard was considered to have more civilian application and was thus more politically friendly than the US Army's competing (and better) Jupiter booster system.
After the success of the USSR's Sputnik 1 and 2 launches, and the USA's highly publicized Vanguard failures to put a satellite on orbit, Eisenhower gave the reigns over to the Army (led by German ex-pat Von Braun) and their Jupiter missile, which finally succeeded in launching Explorer 1 in January of 1958 on its first attempt. The Jupiter vehicle most probably could have beat the Soviets to space, as it was capable of flying prior to Sputnik 1's launch in October of 1957, but politics got in the way of that, and resulted in the USSR putting not one, but two satellites in space before America could respond. Personally (and I am a space program historian, so I will voice my opinion here that I know is shared by many others in my field), it turned out to be a good thing for humanity that the USSR beat America to space with their Sputnik 1 satellite, because that MASSIVE propaganda victory the USSR gained - coupled with the at least equally impressive victory of putting the first human being - Yuri Gagarin, on orbit in April of 1961 - really spurred the citizens of the USA to dramatically enhance their support of civilian space exploration and military/intel space efforts, and that public support (in particular, the financial backing) was instrumental in the eventual success of the USA's Apollo program putting men on the Moon in July of 1969.
One thing that must be appreciated when looking at the early Soviet successes (and I will say that this ultimately in many ways led to their loss of the "Space Race", with the USSR failing to land a man on the Moon before the USA), was that the Soviet leadership in a lot of ways valued quick propaganda victories over hard science and longer term tech development. The USSR recognized that being "first" to do something would go down in the history books forever and be a massive coup for the communist ideology they so heavily touted, and it seems that the Soviet leadership, in their minds, felt that being "first" to pull off a feat was better for them propaganda-wise geo-politically than being "best".
Indeed, if you have a look at the historical timeline, you can see that the Soviets seem to have had a very impressive number of "firsts" in the Space Race. I know this link is to wikipedia, which is typically frowned upon here in this subreddit, so I apologize for that, but the info on this page is certainly accurate, and I post it as it just shows those who may not be aware the many notable "firsts" that the Soviets achieved in the Space Race, which by any standard were pretty damn impressive.
As the "Space Race" progressed into the 1960s and even the 1970s, it becomes clear that the USA valued technological sophistication above being the "first" to accomplish a space milestone. By just about every measure, both in the civilian and military/intel arenas, most of the hardware flown by the USA was much more technologically advanced than that which was flown by the Soviets - from early spy satellites and lunar/interplanetary probes to the manned programs - this was the case. For example, America's Mercury capsule was more advanced and had better capability than the Soviet's early Vostok. The USA's Gemini 2-man capsule system was better than the USSR's Voskhod, and the Apollo CSM/LM stack system simply blew away anything the Soviets had (their Soyuz capsule and the unsuccessful "LK" lunar lander) in terms of capability on orbit. Likewise was the case with most of the unmanned lunar (the USA's Lunar Orbiter satellites for example) and interplanetary probes (America's Mariner martian orbiter and Viking martian landers for example) that America sent into space, which were able to gather far more data and were more advanced by just about every measure than that which their Soviet counterparts/competitors fielded.
The technological superiority America had cost big bucks of course, and American space expenditures (again, in both civilian and military arenas) was significantly higher than the Soviets were able/willing to invest. The Soviets spent a lot of effort working at ensuring they would be the "first" to do things in space because of the huge global propaganda value those successes gave them, whereas the Americans spent considerable effort and money (and time) ensuring that they were developing more complex hardware that would perform better and give better return on science investment, focusing on things outside of the mere propaganda victories that seemed to be a huge driving force behind many of the Soviet-era space efforts. That American tech development took more time than that of the USSR, so the USSR was able to fire up into space less technologically capable satellites and spacecraft because they spent less money and time/effort on the technological development of their vehicles, which allowed them to beat the USA to the punch and be the "first" to reach certain record book milestones in many cases.
Again, I am admittedly being very simplistic with this answer, as it is a very in-depth question you are asking, but the jist of the answer is that the USSR recognized they could be the ones to accomplish many space firsts and reap the propaganda rewards by investing in and focusing more on that goal of being the first in the record books to do things, whereas the Americans focus (both civilian and military) was centered around technological superiority which was deemed to offer better long term gains, rather than trying to always beat the Soviets to the punch. Simply put, I think it is fair to say that the USA won the Space Race because they decided to treat it as a marathon, whereas the Soviets focused more often than not on "sprinting" in order to get the quick propaganda victory of being the "first" to achieve certain landmarks in the record books.