As zoogie was saying, CIA is actually a container format containing one or more CXIs, with CXI simply being a generic all-in-one executable package containing both the code and assets.
It's not a piracy-specific thing, and could have some benefit to homebrew developers, as it would make it easy to bundle assets into the homebrew, so that whether loaded from HBL or from an installed CIA, there would be no extra files/folders needing to be loaded from the SD card.
You can obviously bundle assets into an elf, and then pack that elf into a .cia and .3dsx and achieve the same result, but if I'm not mistaken, an elf is loaded entirely into memory, so this wouldn't work for large amounts of data.
I'm not sure if there is any way to dynamically load data tacked onto an .elf in a universal way that would also work when packed into a .cia and for that matter, any data tacked onto an .elf might automatically be loaded into memory anyway. So there might not actually be any other good way of accomplishing it without the use of a .cxi or some new custom file format with accompanying homebrew launcher support and a packer to pack the data into a .cia. I don't actually know though.
Anyway, smea decided on using a custom format for compatibility reasons, and that might have been the right decision back then, but now that people are almost exclusively using Luma3DS with Rosalina to launch homebrew, compatibility is no longer much of a concern. .cxi loading does seem like it could provide some benefits to homebrew devs, but at this point, I'm not sure how much point there is to it since most devs have moved on from the 3DS. Of course, there's no specific reason homebrew would use a proprietary Nintendo file format when new loader code would have to be written for it anyway. They could choose literally any file format they wanted. Using a format that already exists on the system might make it easier to write said loader code, though.