The actual answer is pretty simple: Donating the body to “science”. Last Week Tonight recently made an entire episode about this: donating your organs and body and where it can end up (and especially in the case of donating the body, it can end up in all kinds of places).
So it’s ethically as in the people donated it and were aware of giving it away, but at least most of them certainly didn’t know that this is what their skulls could end up being used for.
Would be interesting though