Falcon 9 is planned to launch maybe twice a year crewed, compared to 20 or 30 uncrewed launches (including like 2 or 3 uncrewed Dragon launches), meaning any new systemic problems with the launch vehicle will almost certainly pop up in an uncrewed launch before they result in loss of crew. Shuttle ONLY launched uncrewed, therefore any systemic problem which resulted in a loss of vehicle necessarily resulted in loss-of-crew.
Don't you mean that shuttle only launched crewed? Either that or I think I do not have the same definition as you do for "uncrewed" -- I take it to mean that there is no crew on board?
When did the shuttle main engine fail?
And STS-93 had a pretty bad close call, too, with some of the engine coolant lines rupturing in-flight (leading to early shutdown) due to a oxidizer post plug coming undone as well as an electrical short taking down some of the engine controllers. That was pretty early in flight, so would've been incredibly risky in the case of an abort. https://en.wikipedia.org/wiki/STS-93
Falcon 9 has higher levels of first stage redundancy than Shuttle (can lose a first stage engine immediately at lift-off and reach orbit just fine, and lose multiple engines later in flight), and uses just a single upper stage engine, reducing probability of failure.
But SpaceX necessarily WILL be safer because they're using a proven vehicle and a more robust capsule. Plus a launch abort system. Shuttle flew crewed on the very first launch.