Q:

Why was it necessary to travel back to Dragonstone? 

In S7E7

 After the (un)successful treaty with Cersei was it necessary for Daenerys and party to move back to Dragonstone for further planning.  They had all their army present at Kings Landing.  Wasn't it easy to plan and move to North from there directly?  

I don't think they will leave KL without the army and it's such a waste of Time and effort to travel between places with such a huge army. 
Edit:
Even if they are travelling without the army why does it make sense for them to go back to Dragonstone? 

A:

The answer
Real answer is, We do not know yet that whether they pulled back their forces back to Dragonstone or not. 
The Speculation
The Targaryen council indeed held a session at Dragonstone rather than King's Landing but it doesn't imply that they withdrew their forces from Outskirts of King's Landing.  Cersei made no such demands and as you noted, it seems a terrible waste of resources to pull back their army, only to deploy it once more at the very same place.  The location of the council could simply be because Daenerys doesn't trust Cersei or because she prefers planning her moves from her own Castle, rather than in a tent outside the city of an unreliable ally. 
The Targaryen council have the following plan:

Jon: If we have the Dothraki ride hard on the kingsroad,
they'll arrive at Winterfell within the fortnight. 
Daenerys: And the Unsullied? 
Jon: We can sail with them to White Harbor, meet the Dothraki here on the
kingsroad, then ride together to Winterfell. Season 7 Episode 10 -
The Dragon and the Wolf

Daenerys consented to Jon's plan of sailing together to White Harbour. 
So it appears to me that they are not going back to Dragonstone. 
The Dothraki are going to take the King's Road straight from King's Landing to the North, probably because they are mounted and prefer to avoid maritime transports.  We do not know where they are yet but since Jon says they can ride along the King's Road, I believe it is implied that they were not pulled back after Westeros Peace Summit. 
The Unsullied on the other hand are going to sail to White Harbour, North's chief port, and then march West towards King's Road and then join the Dothraki. 
Ships would make much better time than mounted Horselords so it is likely that Unsullied would be in the North by the time the Dothraki arrive.  Even if some storm causes delays, Dothraki can wait for the Unsullied or march towards Winterfell themselves.  At least that's the plan. 
While it seems implied that the Dothraki won't be coming back to Dragonstone, it is unclear where exactly are the Unsullied when the council was setting out the plans for Battle for Dawn 2.0.  They might be still outside King's Landing.  Or they might have sailed back to Dragonstone with Daenerys. 
I believe the trip back to Dragonstone makes sense for the Unsullied.  It will allow them a brief period of rest and will allow for the Targaryen Naval captains to reload their supplies and provisions which shall be needed for the Campaign North. 
I have created a map to graphically illustrate the plan mentioned above:

There are two positions for the Unsullied because we do not currently know their whereabouts. 
But then again, we have to note that if Dothraki are still outside King's Landing, Cersei can't expect to Double Cross Daenerys without her knowing.  If Daenerys sails all the way to the North and only then finds out that Lannisters never arrived, her treachery could go unpunished. 
But it is unlikely that Daenerys would not know that Lannisters never marched if she actually has loyal men outside their city.  They would inform her that the Lannisters never marched when they left the city, as they should have if they expected to reach the North in time.  As Jaime noted, under the impression that Cersei was committed to her words, that they will need to march at maximum within three days if they hope to reach the North within two weeks.  And if Dothraki never saw them marching, reports would reach Daenerys certainly. 
In Conclusion:

Dothraki will most likely continue from King's Landing to the North.  As they are a mobile force, they don't need ships to ferry them all the way. 
The Unsullied would however take the ships at King's Landing or Dragonstone and then land at White Harbour.  They are infantry and need transport to catch up with the Horselords.