Saint Maximus the Confessor enumerates five reasons why God lets the devil war the people:
The first reason is to learn how to distinguish virtue from wickedness during this war.
The second reason is to `constrain` us somehow to stick fast to virtue with all our heart and firmly.
The third reason is to make us not to pride ourselves when our virtue grows but become aware due to this spiritual struggle that any growth is a gift from God.
The fourth reason is to humble ourselves and make us be aware of, hate, confess and leave our sins which became cause of temptations.
The fifth reason is to make us remember our own helplessness and the power of God when by making progress in our spiritual struggle we become worthy to reach a certain virtue.
In the five reasons from above it shows the love of God for man. We should not forget that sorrows and temptations are the gifts of God’s love for man because during these trials we can – if we want – meet Christ Who suffered and was crucified for us and He will revive us into eternity.
At last the devil by all his plots and intrigues against us destroys himself and the divine love for men wins. In the same way the trap of the Cross put by the devil to Christ became in the end destruction of the devil and victory of Christ (for this reason the Cross is since then the most terrible weapon against the devil)any trap the devil sets against us may become a defeat of the devil and a cause of our salvation. Only with a condition: to face any temptation by cutting our own will (our selfishness) and by listening unconditionally the will of God.
Source: Diahronikes Litrotikes Alithies