It absolutely isn’t valid. It is mathematically incorrect.

Expressions involving invalid “entities” are invalid. So how why does this work?

The reason is that the symbol — rather the string of symbols — 0\cdot \log_2\left(0\right) takes a modified meaning of that that one would expect.

Even though it is meaningless to multiply zero with something that doesn’t exist, it is true that \lim \limits_{x\to 0}\left(x\cdot \log_2\left(x\right)\right) equals 0. Therefore, purely to use convenient notation, we define 0\cdot \log_2\left(0\right) as 0.

It may look silly to write 0\cdot \log_2\left(0\right) instead of 0, and it is. The reason why the notation is convenient is because it is easier to write \displaystyle \sum\limits_{v\in A}\frac{|T_{v}|}{|T|} \cdot \text{Entropy}(T_{v}) \nonumber with the understanding that when \vert T_v\vert is zero, we mean what I explained in the paragraphs above.

Handling this case separately would make the notation heavier.