Scholars have different opinions about that.
1- Some sources indicate he was imprisoned, so he could not go to Karbala.
2- Some clues indicate he was instructed by Imam Ali (a) to fulfill certain missions, so it was not an obligation for him to go to Karbala.
3- Some say he didn’t make it in time.
I believe the first one seems to be the most plausible reason.