Wall Street stocks gained ground as softening inflation data and a robust beginning of second-quarter earnings season put investors in a buying mood.