The Shadow Temple was historically a place used by the Sheikah to interrogate and torture enemies of the Royal Family of Hyrule.
Said song is taught to Link by Sheik after Bongo Bongo is freed from its imprisonment in Kakariko Village. The entrance is found in the back of the Kakariko Village Graveyard in a little alcove only accessible using the Nocturne of Shadow.