
It’s to combat a certain type of shoplifting.
As the OP probably already knows, in Japan, it’s generally shoppers rather than the checkout person who do the transferring of items into those plastic grocery bags. Shoppers pay, then are given enough plastic bags to fit all the items they’ve bought. They then take the bags along with their baskets full of groceries to a designated area behind the checkouts where they go about filling them to take home.
Meanwhile about a decade back, supermarkets across the country introduced the “eco bags” (a.k.a. “my bags”) policy. In the name of being greener, these supermarkets no longer provide shoppers with free plastic bags. Shoppers are instead required to pay extra or bring their own bags (usually a tote bag).
A subsequent downside of this policy was that the brazen practice of taking a basket full of unpaid items straight to the designated area (known as “kagonuke”) became much more prevalent due to the simple fact that perpetrators no longer needed to obtain plastic bags at checkouts.
Different coloured baskets for before and after checkout allow patrols to more easily distinguish between paid and unpaid items.