I ran into the same issue and really it is and is not your fault. It is your fault because you probably started researching everything you could. The reason it is not is because the game does not do a good job of telling you that to get a new tech (item for your rover) you need specific things only. So researching all willy nilly results in your going broke. BUT if you research deliberately, so only researching what you will need for that next mission piece, then your money will stretch.
Sadly the only path I can recommend is restarting your game and be more cautious with how you research things. Look very carefully at what you will need for that rover and do not blow funds on anything that is not for a mission early on. Or else you will hit a wall. Once you have the rovers though, there are "free form" missions that you can do on Mars. So fininshing a mission does not mean that your rover can not earn you more money by say taking more pictures. :-)