I read that Custer was a poor officer during the civil war.
Not exactly. He'd had many impressive victories during the civil war when he was so young that he came to be called the Boy General. You dont rise to such a high rank at such a young age by being a bad leader. As an officer he did have his faults, but he brought the army a lot of victories.
The reasons for his defeat at the bighorn were basically just unforeseeable bad luck, and the responsibility of his other officers just as much as him. He split his force up, which was standard practice, but that caused his force to be cut off and outnumbered. They died because the others didn't come to his aid when he needed it