BERLIN—Google said on Tuesday that it was taking legal action over an expanded version of Germany’s hate-speech law that recently took effect, saying its provisions violated the right to privacy of its users. The Alphabet unit, which runs video-sharing site YouTube, filed suit at the administrative court in Cologne to challenge a provision that allows…