Gagliardini scored twice and Joao Mario claimed two assists in the rout at San Siro, as Inter made it seven Serie A wins in a row to move into second place.
While Joao Mario has come in from the cold in recent weeks, having failed to secure a transfer away from the club in the off-season, Gagliardini has made seven Serie A appearances.
However, just four of those have been starts, and the midfielder was left out of Inter's squad for the Champions League, which was restricted to 21 players due to financial fair play restrictions.
And Spalletti has praised both Gagliardini and Joao Mario, as well as back-up full-back Dalbert, for their commitment and attitude despite not featuring consistently.
"When I left Gagliardini out against Lazio, he was clearly disappointed," Spalletti told Sky Sport Italia.
"He is off the Champions League squad list too, but he showed how much he wants to help the team and give his contribution.
"If Gagliardini had come to training with that disappointment and lowered his head, then he wouldn't have performed like this.
"He was rewarded for his professionalism and we have several players like that, most evidently Joao Mario, but also Dalbert who did well today.
"Dalbert can get anxious and make mistakes with the easiest of moves, but I am glad he had a strong performance today and I hope that'll help."
Inter's victory provides the perfect warm-up for their next clash, with Barcelona travelling to San Siro in the Champions League on Tuesday.