Answers here will vary considerably by state.
For my home state, all gas taxes, tab fees (registration), and sales tax on motor vehicle sales must be used "solely for highway purposes" by state law.
For MN, 28% of highway funding is paid for by gas tax, registration covers 23%, vehicle sales tax 14%, Federal Aid is 24%, bonds cover about 7%, and 3% comes from other sources.
That is only the highway system. Local roads outside of the State Aid system are paid for by property taxes and bonding primarily.
Long story short, no funding here goes to other projects.
Reality is that having a fixed gas tax causes problems. Between higher mileage cars or electric cars and hybrids, these vehicles do not pay a proportionate amount of gas tax. In addition, when not indexed to inflation, a fixed cost does not match the reality of construction costs. Anybody tried to build a road lately? Any idea what current costs are compared to 10 years ago? 20 years ago? How about 26 years ago (the last time the federal gas tax was raised? (Hint: General inflation since 93 is about 75% - meaning the 18.4 cent federal tax in 1993 is now worth much less.) States are all over the map here, but the story is generally the same.
Blame it all on others, corrupt politicians, corrupt road builders, etc... but ignore the reality of what a fixed gas tax can and can't do at your own peril... In many places, we are expecting our roads to be top notch while paying significantly less (when inflation is accounted for) than we did even 10 or 20 years ago, and then scratch our heads why we don't get what we think we should.