The margins on tech/cloud are just so astronomically higher than retail. Places like Walmart or Costco are fighting for <5% profit margins, IIRC its closer to 2%. Quick search says AWS has about a 35% profit margin and about 50-60% of the operating profit of amazon but 17% of the Revenue. With those numbers it makes sense to focus on AWS.
IMO AWS should be spun out as a separate company.