To begin with, we have to recognize that NASCAR is deeply rooted in the South, and that Southerners by and large made up (possibly still make up) the bulk of fans. There is really two factors at play here, first, that NASCAR has its beginnings and depth in the South, where Confederate/Rebel imagery is prevalent, but secondly, that even as NASCAR has branched out or moved away from that image, many of its fans still held on to the older image.
Racing is a universal sport, of course, from chariots to horses to Formula 1. The National Association of Stock Car Auto Racing, or NASCAR, begun in 1949 has pretty much been built and operated in the South. Drawing from Coski's The Confederate Battle Flag, early races included the Dixie 500 in Atlanta, and the Dixie Speedway in Alabama, both utilizing Rebel flags and Confederate imagery. Then there was the Darlington Speedway in South Carolina. The races there in the 50s and 60s plastered Confederate stuff everywhere. Some races even used a form of checkered Confederate flag instead of the usual black and white checkered flag for the finish. When the first black driver, Wendell Scott, attempted to break into the sport, he found widespread opposition from tracks as well as team owners, since many of the races were in deeply segregated Southern states.
NASCAR and the South practically were intertwined for the last half century. In the 1950 season, of 19 races, 10 were held outside the South (several at the same track on different dates). In the 1970 season, of 48 races, only 7 were outside the South, and again, in 6 separate locations. North Carolina, especially, is the nexus of the racing universe. It is also the location of the NASCAR hall of fame, which opened in 2010. Of the 50 inductees, 39 are Southerners.
Perhaps more importantly, the use of Confederate flags in NASCAR is by far mostly seen by the fans who display it. (Side note, I've been to Talladega Superspeedway, and there were more Confederate flags on display than Robert E. Lee probably possessed in the entire Army of Northern Virginia) This is where we really need to look at NASCAR's relation to the South, and how it has been cemented in pop culture as the sport of "rednecks." "Redneck" culture has often been intertwined with use of Confederate symbols, and therefore permeates into NASCAR as well. Start playing "Eastbound and Down" anywhere in the white South and I dare you to find someone who doesn't know the lyrics. The Duke boys drove the General Lee with large Confederate Battle flag on top, and even the Bandit's Tans-Am featured the state flag of Georgia, with its Confederate flag embedded. Thousands of Southern white kids (or perhaps I should say country/redneck kids, and won't try to really get into the differences) were raised on shows and movies like those, and on Richard Petty and Dale Earnhardt. You can still find kids today where I'm from in western Kentucky who paint the number "3" on their bikes or go-karts. "Rednecks" also used the same flag to promote segregation and oppose bussing. It was waved by fans at Ole Miss for years before James Meredith integrated it. Without trying to get into the lengthy history of the use of the flag in other areas, suffice to say that you can buy Confederate flags with other things on them, as a weird, convoluted mixture. I've personally seen Earnhardt's number 3, Hank Williams Jr.'s face, skulls, and wolves for some reason. There is no end to the ways a Confederate flag may be used and displayed on clothing and objects, to say nothing of it being flown simply as an actual flag.
From Jeff Dunham and his doofus redneck friend Bubba J., to Jeff Foxworthy, the trope of "their makin a left turn!" as testament to how stupid NASCAR fans must be, is widespread. Foxworthy even had a bit in his Blue Collar Comedy Tour (2003) in which he says he finally figured out why everyone seems to hate Jeff Gordon. It was because "Jeff Gordon enunciates. And there's no room for that in NASCAR." He then goes on a seemingly unintelligible (I say seemingly, because if you speak country fluently, it all makes sense) tirade emulating a typically country-talking driver, insinuating that THAT is the kind of driver you want to see in NASCAR. Talladega Nights took the stereotype even further. That stereotype is born from the reality that NASCAR has overwhelmingly been a Southern, white-dominated, sport. Out of some 3,000 drivers, there have been only 8 African-American drivers to race in NASCAR in its history. Further, few schools in the nation have racing programs, and there is no NCAA racing that one could go to college for. This means that becoming a racer in NASCAR means you grow up doing it as something on the side, and to become good at it, you generally have to have money to invest, as unlike most sports, your equipment will get damaged in every single event. Racing then is also a family sport, which is why its not uncommon for last names to reappear frequently, like Petty, Earnhardt, Allison, and currently, the lineup includes Chase Elliot, son of famed driver Bill Elliot, and Ty and Austin Dillon, both grandsons of legendary team owner Richard Childress. So a sport that is centered in the South, largely promoted and operated by Southerners, and is largely exclusive to be a part of, contains a large fan base who are also Southern and employ the Confederate flag in all kinds of ways (all of them using a symbol of white supremacy).
Over the last 30 years, though, NASCAR generally has expanded its reach, including new tracks all around the country, to far more drivers coming in who didn't grow up in the South. Nevertheless, the core fan base is largely rural at minimum, and more Southern than not. Although NASCAR as an organization has not promoted Confederate imagery in a long time, many thousands of their fans still do.