You’re right in characterizing Lucifer’s rebellion as an insane act. Don’t forget that, although Lucifer had a superabundance of spiritual gifts, he was also endowed, as we are, with the gift of free will. God left him free to choose good over evil, and, as we know, he chose evil.
Consider Adam and Eve. Before the Fall they possessed immortality, control over their passions and appetites, the complete integrity of their wills, as well as a human intelligence far superior to that which we have now. Yet, like Lucifer, they chose to commit a mortal sin. This means God allowed them to exercise their free will.
As for the particular sin the bad angels committed, many theologians believe that in their pre-fallen state the angels were given a foreknowledge of humans (who would be inferior to them), as well as a foreknowledge that God himself (the second Person of the Trinity) would be incarnated as a man and redeem the universe through his death on the cross.
This revelation angered Lucifer because it meant he and the other angels would have to worship God incarnate. Lucifer and the other angels who fell were so proud of being superior to men that their overweening arrogance wouldn’t allow them to worship Jesus Christ the God-Man. This refusal–this non serviam–stemmed from pride. That, anyway, is the theologian’s theory.