This is such a moot point.
That Amazon a "retail" company was able to roll out Kindle and popularise E readers (while handling distribution)...
That Amazon were able to roll out AWS, a highly profitable cloud platform...
That Amazon are in the process of launching automated drone delivery...
These facts are not coincidence, they are inextricable from Amazon being what it is - a tech company that happened to start with Retail as its cash cow. It's an innovative company that is not content sitting around getting fat the second it reaches some sort of comfort zone, and until running a company like this becomes the norm, they can afford to command higher PE ratios while people anticipate their next big blockbuster product.
To compare Amazon to Walmart, a company whose be all and end all is Retail, is missing the bigger picture.
(nb that's not to say that their current trading ratio isn't overinflated)
Only time will tell, but if Amazon continues bring users into their Prime ecosystem and AWS maintains its position, there's plenty of room to increase profits.