This is my "gut feeling" only, I don't have any rule or example to support it.
The difference between
I need to make money for paying my bills.
I need to make money to pay my bills.
is subtle but discernable.
The former identifies an activity (paying bills) and speaks of the need to make money as a prerequisite. As if, "among other things I have this 'bill paying' thing that I can do, and the money is required for that, so I need to make it".
The latter puts bill paying to the forefront, so to speak, as if there is nothing else. Again, money making is a prerequisite but the repetition of 'to' puts a stress on the actions, draws them into the limelight.
"For paying my bills" does not indicate it as a priority. Just another purpose among so many, of making money. "To pay my bills" speaks to me of urgency, of vital importance.
Same notion with the cake.
I need the ingredients for making a cake.
Basically says that if some cake ingredients happen to be around, I'll take them. I might make a cake with those, or might just put it in my pocket book.
I need the ingredients to make a cake.
Says that I am going to make a cake and ingredients are wanted.