Because Charlotte was doing it to save Wilbur's life. The point was for him to get all the credit. Wilbur himself does not take all he credit, just the people who see the "miracles."
You're right, it doesn't make sense. That occurred to me the last time I watched. Mr. Zuckerman flatout says, "There it is!" about the "grey spider," so it seems odd that all the glory would be given to Wilbur, from the standpoint of the characters, not the author (I understand she was trying to save his life, but that's not the point here).
If I had a magical spider that could weave English, I'd be pretty impressed with it...
Only Mrs. Zuckerman and Fern tried to credit Charlotte. Mrs. Zuckerman was quickly quashed by Mr. Zuckerman and Fern wasn't believed. There's probably a huge lesson there.