I was having a race with my black friend and then my mom pulled me aside to scold me for playing with my food.
Are you trying to say that Black people are food?
Come on, I'm only joking.
Regardless of whether you're joking, the implication is that Black people aren't people, which is hurtful and degrading. Don't tell jokes where the punchline is racially insensitive, otherwise you're going to offend someone and you may get in trouble.