"because of" is #28 in meanings of "for" on dictionary.com. If you think about it, "for the purpose of" and "because of" are closely related. "Shout for joy" is both "Shout for the purpose of joy" and "Shout because of joy".