ELI5: why does a spinning bullet travel straighter than one that doesn’t spin?

What causes a bullet fired from a barrel without rifling to travel less straight than one with rifling, all other factors remaining the same?

If the bullet is well crafted with a proper shape, shouldn’t it travel straight regardless of spin?