I've done that before. For me, I wasn't used to people wanting to spend time with me, so I just didn't plan accordingly. I got in the habit of being alone that when an opportunity for friendship came up, I felt like I messed it up.
I don't think you're a bad friend. It just takes practice learning how to make time for new friends when you're used to not considering more than a few people. I had to learn to set energy aside for outings, and I'm still working on that. I want to be better friend, but the people who care about me, understand this. They don't judge me.
Just explain it to him that you honestly forgot. You sincerely apologize, and hopefully he will understand too.
Be who you are and say what you feel, because in the end those who matter don't mind and those who mind don't matter. - Dr. Seuss