I'd recommend considering what you want out of each. Presumably, if you are working for company on a programming related internship, you want some mix of:
Good technical experience solving hard technical problems
Contact with potentially great collegues who might be mentors, coworkers, or a part of your professional network.
- The possibility of a future paid position with the organization
- A bullet on your resume (IMO - the lowest priority - a bullet for an intership has a shelf life of < 5 years, professional experience, personal contacts and a job offer can last a lifetime).
2 out of these four goals may be helped by having two internships at once (the technical expeirence, and the bullet on the resume). But the other 2 could be noticeably hurt by trying to split your work between two companies. The more different things you do, the more you have to split your focus. It is entirely possible that you could end up in a situtation where both internships are in "crunch time" and you will not be able to give either of them the attention they demand. This could have a fairly negative impact on both the professional impression you leave with your collegues and the potential for a future job offer.
That's not to say doing 2 projects at once is impossible. I know a ton of software engineers that have a day job and an at-home, for the love of it project. I also know contractors that have a day job and then take on night gigs for erratic work. The guideline here is that the people that do this have a very clear understanding on the priority list, and/or are in a position where they have made a finite agreement with their employers so that they and their companies have a shared understanding of how time will be allocated in a crunch. In the case of a paid, salaried employee, the expectation is that personal projects will be put on hold if there is a crunch in the company's project. In the case of a contractor, the company is paying per hour, and there is no expectation of overtime without notification and negotiation.
Where you are taking on an unpaid internship, I think that if you really want to take on both jobs, you need to have an upfront discussion with both companies about what your availability will be. Generally companies take on interns with the expectation that the company will have to invest something (usually the time of a senior team member and the resources for the intern to do the work) in order to get something. In the beginning the intern is "expensive" in that the intern is getting trained and mentored quite a bit before they start contributing useful work. Towards the end, the intern is expected to pay this back by becoming quite productive, making the intern into a great candidate for future employment, since the company knows that the intern knows the ropes and has already performed good work.
Taking on two internships raises the quesiton of what happens toward the end of both assignments where the company is giving you hard enough assignments that you might need to expend a few extra hours in both positions. Will you be able to do that or will you already be flat out with working the two projects night and day?
While they didn't pay you any money, the companies did invest in you and they have a fair expectation that you will become increasingly productive. I think you owe it to them to be clear about your availability in each position and ready to make a choice if either company is not OK with the arrangement.