"For" is slightly old fashioned (many Indian textbooks recycle examples from older textbooks and many of these were written to teach grammar in the Anglo-Indian schools of the 1930s)
It is rather "novelistic", the style of a person who is writing careful prose for publication, not casual emails or speech.
But "for lack of rain" is correct in the given context.
There are very very many ways to express these ideas in English
To give an example of a modern and slightly slangy expression: "what with..."
They talked about the animals and birds, and the other villages, and how they'd had difficulties growing crops, what with the lack of rain.
"Due to" and "because of" are also good ways of giving a reason.