It's not an uncommon human character trait in general. People even in this day and age at times act like that. People will take credit for their successes themselves and then blame God/gods for their tragedies.
It's a very human impulse and makes him more relatable to audiences from Homer's time to today and less almost demi-god-ish.
But mostly it reveals a serious level of arrogance and pride. In The Odyssey, Odysseus has direct interactions and conversations with the gods. He knows that he would not have been able to accomplish the things he accomplished without their direct intervention, especially Athena's as he is a favorite of hers. To take sole credit for his glories and then to turn around and essentially spit in the gods' faces when he was responsible for his misjudgements in his adventures by blaming the gods is nothing short of supreme pride and arrogance.
First of all, congratulations on reading The Odyssey in the 9th grade! That's a wonderful achievement!
To answer your question, Odysseus is just like most humans: taking credit for the good times and blaming God for the bad. Why do we do this? I think that humans reach out to religion when times get hard, but when life is easy God often takes a backseat because people don't think they still need guidance.
Homer shows Odysseus as being flawed, yet who among us is not? That's the beauty of literature: it exposes the honesty of humanity; and it reveals to us, through characters, our own setbacks.
it tells us that he is a glory hog and he gets mad when things dont go wright.