To make their Goods competitive
Countries which depend heavily on exporting ,such as China, can devalue their currency to make their goods cheaper for other countries and so export more goods. (See Why did China devalue its currency in August 2015?)
To protect their foreign reserves
In some cases the limited foreign reserves of a certain country might be used to keep the exchange rate of their currency fixed. If a country decided to preserve its foreign reserves then it allow its currency to be traded freely and this usually causes devaluation.
To shrink trade deficit
When a currency becomes weaker imports decrease and exports increase. This results in an improvement of the trade deficit of the country as it exports more and imports less.
To reduce Sovereign dept
If the country has a higher Sovereign dept compared to foreign dept then weakening its currency will reduce the amount of Sovereign dept. (See What happens when a country has too much debt?)
To fight deflation
Deflation can be bad for the economy. To combat deflation a country might devalue its currency to make goods more expensive.
To encourage tourism
Tourism based countries might devalue their currency to make holidays in their countries cheaper for foreigners. This devaluation usually results in an increase in Tourism income.
To help the economy
Currency devaluation is sometimes used as a method to help a struggling economy since it can improve the balance of payments.
Why do countries devalue their currency?
Why Countries Devalue Their Currencies? How does a country devalue its currency?