Poor countries have had to divert large chunks of their budget to adapt to climate change and run the risk of crowding out spending on health and education, a new report suggests.