Manager Scott Servais said the neck spasms shouldn't stop Walker from making his next outing in five days, but he called a halt to the 23-year-old's day when he saw the early struggles.
"It bothered him when he came in today," Servais said. "Our training staff tried to work on it and loosen it up. I give Taijuan a lot of credit. He went out there and tried to get loose in the bullpen. It wasn't great there and then obviously when he got in the game, it just wouldn't loosen up.
"I just thought it was best for his well-being and long-term health here and for us as well to get him out of there. He tried to gut it out, but it just didn't happen."
Walker had thrown 35 pitches and was trailing 3-0 after giving up two home runs and two other well-hit balls that were run down in deep center field by Leonys Martin.
Walker took the loss in his abbreviated outing as his record fell to 2-2 with a 1.97 ERA in six starts.
Two of the three runs he allowed were unearned after a throwing error by shortstop Ketel Marte to open the second inning and a two-out, two-run homer by Houston first baseman Marwin Gonzalez.
Walker also gave up a solo shot to Carlos Correa in the first. Walker allowed just one home run in his first five starts.
Walker said he couldn't turn his neck to face the plate or get his full body behind his pitches.
"I just couldn't turn, couldn't finish, I couldn't really use my legs or anything so I was just using all arm out there," he said. "It's not really good trying to pitch five or six innings using all arm. My velo wasn't there, so it was just straight BP fastballs pretty much."
The Astros struck out 11 times and managed just one run and six hits against Walker in six innings when he beat them two weeks ago at Safeco Field, so they knew something was different.
"His velocity wasn't as high in the first inning as it had been in Seattle, and he looked a little tentative," said Astros manager A.J. Hinch. "He looked uncomfortable. I didn't really know what it was, but he wasn't getting down the hill. He wasn't as energetic. He was feeling pretty good when we faced him in Seattle. So there was something that was going on. We didn't really know what. He wasn't letting it loose, and we obviously capitalized early."
Both Servais and Walker expect he'll be fine for his next scheduled start Wednesday in Seattle against the Rays.