In my case it’s mostly a fun way to learn a new programming language - an emulator is enough of a “real program” to exercise a load of different aspects of a new language and its standard library to get a feel for how it works, but also small enough that a new implementation can be done in a weekend[0]
[0] Assuming you already have the foundational knowledge - my first emulator took a week to get the CPU working and a month for the first game to be playable, only using one old and inaccurate PDF as a reference; now that I know what I’m doing, and now that I’ve found gbdev.io for more accurate docs, it’s much faster. Funnily enough I also ended up creating a tool like the one in this article, logging every action that happens in the CPU or RAM to make sure they all match up :)