was the song sung for humanitarian aid?
Yes
We Are the World
Four months after the release of "We Are the World", USA for Africa had taken in almost $10.8 million (equivalent to $ million today). 
who wrote the lyrics to we are the world Lionel Richie and Michael Jackson when was it released? March 7, 1985
wiki:20186213
We Are the World [SEP] Humanitarian aid
The remaining 10 percent of funds was earmarked for domestic hunger and homeless programs in the US. From the African fund, over 70 recovery and development projects were launched in seven African nations. Such projects included aid in agriculture, fishing, water management, manufacturing and reforestation. Training programs were also developed in the African countries of Mozambique, Senegal, Chad, Mauritania, Burkina Faso, and Mali.