I think that in some cases they are different structures to say the same thing, though one or the other may be better in specific collocations. 'To do' obviously indicates its intended action, while 'for something' can indicate either the activity (the noun form of the action) or the purpose (even though your 2nd definition does not indicate the former). Therefore,'to do' is not synonymous and cannot be used when 'purpose' is meant.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.