The spike must have a non kinematic rigidbody attached to.
Or instead of attaching the script to the player, you attach it to the spike.
void OnCollisionEnter2D(Collision2D collision)
{
if (collision.gameobject.CompareTag("Player"))
{
Debug.Log("I am the enemy and the player touched me");
}