To love is necessary.
Loving is necessary.
Loving is adjective. There are two meaning of it: 1.affectionate; 2. very careful and thorough. So, Love is necessary.
Both are grammatically possible.