Ricardo Vaz Te's curling free-kick put the Hammers ahead before former Manchester United trainee Ravel Morrison capped a sparkling performance with a superb goal on his full debut.
The Robins pulled a goal back in bizarre circumstances in the 57th minute when Spanish goalkeeper Adrian, making his debut, got in a horrible mix-up with James Tomkins and was penalised for a foul on Jermaine McGlashan. Matt Richards stepped up to tuck in the spot-kick.
After the second round tie Yates revealed he was well aware of the threat posed by Morrison.
"I'd seen him at Birmingham and his agent was telling me what a good player he is," he revealed.
"We could have done better with that goal but we showed our character - we could have capitulated after that but we didn't and we gave ourselves a chance in the last 15 minutes.
"We rode our luck at times to even still be in it but we had a couple of chances and we showed we have a bit about us.
"But West Ham are a really good side, they've got quality players."