For Spain, Paul Quemada (41st minute, 67th) struck twice while Albert Sala (19th minute), captain Pol Amat (35th) and Ramon Alegre (42nd) were the goal-getters.
Sandeep Singh (39th) and Gurvinder Singh Chandi (43rd) scored the consolation goals for India.
India was defeated by Australia on similar margin of 2-5 on Tuesday, Mar 3.
India has not managed to qualify for the semi-finals in eight World Cup hockey tournaments since winning the title in 1975.
India will next play unbeaten England on Saturday, Mar 6, while Spain will be up against Australia.
England leads Pool B with 9 points, Australia and Spain have 6 each, India and Pakistan have 3 each, and South Africa was yet to earn a point.