It was most likely forbidden by the Capitol, although this is never stated explicitly
Katniss' mother, does however personally forbid her husband and possibly Katniss from singing it
Katniss recalls some memories from the song, including her dad singing it to her in the woods. Recalling that her and her sister would make necklaces out of rope without truly understanding the meaning of the words:
In the stillness I remember the scene. I was home from a day in the woods with my father. Sitting on the floor with Prim, who was just a toddler, singing "The Hanging Tree." Making us necklaces out of scraps of old rope like it said in the song, not knowing the real meaning of the words.
The Hunger Games - Mockingjay: Chapter 9
Katniss' mother was clearly outraged by the imagery of the lyrics reflected on her daughter making rope necklaces (recall the singer, who was hanged, is calling their lover to hang with them and join them in death) that she began to scream at her husband.
Suddenly, my mother snatched the rope necklaces away and
was yelling at my father. I started to cry because my mother never yelled.
ibid.
Katniss' father finally explains that the mother doesn't want to hear the song and that they are no longer to sing it.
He calmed me down and told me everything was fine, only we'd better not sing that song anymore. My mother just wanted me to forget it. So, of course, every word was immediately, irrevocably branded into my brain.
ibid.
It would appear that Katniss' mother simply wanted to protect her daughters' innocence and ensure they didn't get into any trouble singing it in public without fully understanding the lyrics.
I guess my mother thought the whole thing was too twisted for a seven-year-old, though. Especially one who made her own rope necklaces.
ibid.
This would make it seem like Katniss' mother forbade it, which is possible, however, most discussion seem to agree that it was "forbidden" by the Capitol, and Katniss' mother as a healer didn't want to see her husband's back whipped.
I have not sung "The Hanging Tree" out loud for ten years, because it's forbidden, but I remember every word.
ibid.
As @DanielB mentions in their answer, the term forbidden is most commonly used in reference to the Capitol forbidding things.
This however does not leave out the possibility that Katniss' mother's reaction led Katniss to convince herself it was forbidden, even if the more unlikely scenario.
Further reasons for the banning of the song may include its role as a song for the rebellion. It is likely Katniss' father sang it to let others in his district know that he was willing to rise up against the Capitol and that they should join him. This is similar to songs in our history, such as Strange Fruit by Billie Holliday becoming a civil rights movement anthem in the 50s and 60s.