You need to understand Unix file systems before you can answer this question.
The only thing rm does is erase the files name, effectively a pointer from your directory structure to the disk blocks.
When you run
ping localhost > /tmp/test.log
rm /tmp/test.log
redirection does not stop. The command keeps running, and data keeps accumulating in your disk area. You simply have no way to access this data because you erased its name.
You are free to create a completely unrelated file named /tmp/test.log.
As you noted, by attempting to truncate the file, you get rid of the data that used to be there, but the internal file descriptor knows the position in the file it points to and writes after the end of the file extend the file. Hence the leading zeros.
If you want to "reset" the redirection, then you need to kill the ping program, erase or truncate the /tmp/test.log file, and then restart the ping program.
You could also use a program like rotatelogs
ping localhost | rotatelogs ping.out.%Y%m%d.%H%M 600
to rotate the log file either based on the elapsed time or the size of the file.