We don't know the situation in full detail, but given the tech behind the carts for Switch 2 is likely similar to 3D NAND, I'd suggest that it's less about cost and more about supply. 3D NAND takes a LOT longer to manufacture than 2D NAND, but it is also has faster speeds and is technically cheaper at the same capacity due to its design. The choice to go with 64GB carts is likely because they (Nintendo and Macronix) don't have the time to go making multiple sizes. Plus, going with the bigger size can help in reducing costs over time.
The thing is, there are games that most definitely can't fit into a 32GB cart or less, where using the 64GB size made sense, but they chose not to go with that anyways and opted for Game Key Cards. If those GKC were not available, then those games would be digital-only. This is on the devs and publishers. Compression with Switch 2 games use the FDE block designed for the task, but it only works on specific formats. To go using a different compression format means alienating the use of that block, and going back to having the CPU do it at a slow pace.