Ponyboy doesn't explain his reason for claiming that he killed Bob, so it is up to individual readers to come up with a reason. Look to the very end of chapter 11 for this exchange between Randy and Ponyboy:
"Listen to me, Pony. You didn't do anything. It was your friend Johnny that had the knife. . . ."
"I had it" I stopped him. He was looking at me strangely. "I had the knife. I killed Bob."
Randy shook his head. "I saw it. You were almost drowned. It was the black headed guy that had the switchblade. Bob scared him into doing it. I saw it."
I was bewildered. "I killed him. I had a switchblade and I was scared they were going to beat me up."
"No, kid, it was your friend, the one who died in the hospital. . . ."
"Johnny is not dead." My voice was shaking. "Johnny is not dead."
Based on this brief exchange, I think there are multiple reasons as to why Ponyboy would claim that he killed Bob. What is clear to readers is that Ponyboy isn't thinking clearly, so that could mean that Ponyboy truly believes that he killed Bob. It's also possible that Ponyboy is not remembering completely correctly because of the traumatic nature of the event. He clearly remembers bits and pieces of it, and he is putting it together in an order that makes sense even if he doesn't truly believe it. A third reason for him to take the blame becomes apparent with Pony's final statement: "Johnny is not dead." If Ponyboy thinks this on any level, then he could be taking the blame for Bob's death in order to protect Johnny from any legal repercussions or consequences from the Socs.