Well... it depends what is your goal.
Let me explain...
When you configure a SPN on a Server, it's to give the ability to a client to connect to this service using Kerberos authentication.
If it's a schedule task that run on a Windows Server and only this server will make the calls to other servers, there is no need to create a SPN because nobody will call the scheduler.
The SPN has to be configured on the Active Directory object where the service is running
Let say you have a SQL Server instance (let say the default instance) that is running on SQL001
The SQL Engine Service is configured to run using the computer account.
In that case, the SPN has to be configured on the computer account SQL001 because when clients will try to connect to the SQL Server (SQL001), they will request a Kerberos ticket that match the server name.
I that case, the command to register the SPN would be --> setspn -S MSSQLSvc/SQL001 SQL001
Another scenario is if the same SQL Server is configured to run using a Group Managed Service Account (gMSA) called gmsa_sql$
In this scenario, the SPN has to be configured on the gmsa_sql$ account.
I that case, the command to register the SPN would be --> setspn -S MSSQLSvc/SQL001 gmsa_sql$