If cortisone injections are just a "band aid"and not a fix, why would a doctor recommend it for carpal tunnel instead of just doing the surgery?

Band Aid is Misnomer. I would not refer to cortisone injections as a bandaid. Often they buy you time while you address the underlying condition with physical therapy or work changes. Surgery is not always successful and can lead to worse problems in some cases.
Because . It's not just a band aid. It works a lot of times and may prevent you from needing surgery and recovery time.