On most cars, you didn’t say what your is, if the wheels were aligned before the ball joints were replaced, then an alignment is not necessary. However, by the time a car needs new ball joints, it probably needs an alignment too.
Heres the catch-22, it is very difficult (impossible) to do an alignment when the ball joints are worn, so having a recent alignment means that it probably really isn’t aligned.
The bottom line is that you probably needed the alignment.