@axelh
Remember that whilst ham8 only allows you to directly modify the 6 most significant bits of each gun, all 8 bits arrive at the DAC. If a palette colour set the lowest 2 bits of any colour, subsequent ham pixels would inherit them.
Furthermore there image displaying methods that change some of the the palette entries per scanline. Such images can show a lot more than basic 18-bit colour resolution.