Quito has a ton of things to see and do; Guayaquil has very little. But Quito sits at 9,400 feet elevation, and the altitude adjustment isn't easy for everybody.
The timing of flights to the islands doesn't line up well with international flights. You really are stuck spending at least a night on the mainland, either in Guayaquil or Quito.