In California, most of the gas tax does go to roads. The issue is that general fund money that used to go to roads is now going elsewhere so the net funding is not going up. In fact it's going down as vehicles become more fuel efficient and use less fuel. And electric-only vehicles pay no fuel taxes at all.
Part of the problem with the gas tax is that is so regressive. The people buying the newest cars pay the least. The people driving the older cars pay the most.