God allowed angels, including Satan, to sin because it was within His sovereign plan to do so. Ephesians 1:11 says, "also we have obtained an inheritance, having been predestined according to His purpose who works all things after the counsel of His will." So, the fall of Satan and of the demonic horde is all according to God's sovereign plan. He allowed them to exercise their free will and rebellion against him. But ultimately God uses that for his good purpose.
But when we ask exactly why did God allow it, we can only offer opinions. Perhaps God allowed angels to sin so that the Lord God could perform the greatest act of love, namely, laying down His life for others. Jesus said that the greatest act of love is to die for someone (John 15:13). 1 John 4:8 tells us that God is love. John 3:16 tells us that God so loved the world that He gave His only begotten son. We can see that the nature of love is to be other-centered, to be sacrificial, and to even sacrifice one's life for another. Since the Bible says that God is love, perhaps it was necessary for angels to fall so that sin could enter the world and so that Jesus in the incarnation could die and by that death redeem others.
Some might argue that God allowed the angels to fall because it was according to their free will. In other words, they had the free will choice to stay with God or not stay with God, and the Lord allowed them to make that choice.
Perhaps it might be that everything created does not possess the quality of holiness. Holiness is a characteristic of God's divine and perfect nature. It is, among other things, the inability to sin. Perhaps it is a necessity that all sentient creatures who do not have the quality of holiness (because it belongs to God alone) will inevitably end up sinning. This would make sense in light of the idea that God has to elect angels whom He has chosen not to sin (1 Timothy 5:21). They were the ones kept by God from committing sin.
We cannot know why God specifically allowed the angels and Satan to fall and allow sin to enter into existence, but we can trust that God in His great sovereignty and wisdom allowed it for reasons that ultimately will bring glory to Him, vindicate His purity, demonstrate His love, and show His power above evil.