It’s due to the different use cases of each API. The contacts API is generally used for creating offline contacts, similar to creating a contact manually via the UI. If a HubSpot user deleted a contact, and then manually added the contact again via the UI, HubSpot would allow the creation (since it’s clear given the user’s actions they want to recreate the contact). This is mirrored in the way the contacts API functions.
The tracking code API is different, though; with the tracking code API, contacts can be created as a result of normal visitor tracking. If a contact is deleted by a user, we’ll stop collecting their analytics info. Since the tracking code API contact creation occurs as a result of the normal visitor tracking, we’ll also stop collecting that. This mirrors the way the existing visit/page view tracking functions. Note that if the contact submits a form, or is created by a user, the analytics info will still exist and continue being collected.
I hope that helps clarify the difference in API behavior. If you have other questions or would like advice on dealing with edge cases like these, please let me know.