The Master Key is used to protect all your certificates' private and asymmetric keys of each TDE database. It's pertinent it exists on your server for best security and prevention of someone gaining access to the keys of one of your TDE databases, and by Microsoft's design the Master Key lives in both the TDE database and master
database.
The certificate also gets created in the master
database so that it can be used by the user databasedatabases that you want to apply TDE to, never. The database encryption key gets created in the user database you're applying TDE to and uses that global certificate from the master
database.
For more information, these Microsoft Docs - SQL Server and Database Encryption Keys (Database Engine) clarify the purposes of the Master Key and where it's stored, specifically the Database master key section. Additionally the documentation on Transparent Data Encryption provides good details and shows an example of creating the Master Key in the master
database but the certificate in the user database they're applying TDE to.