If "chléb" is masculine why does it come with the "to" demonstrative?
This is the negative form of the very familiar and heavily used to je/to jsou construction, generally translated as "it/that is" and "they/those are".
I wrote “Ten chléb není dobrý” and it marked wrong, is it?
That is a different sentence. "That bread is not good.".
What is wrong with the sintax : to chléb neni dobrý ?
Chléb is masculine. You can have "Ten chléb není dobrý." for "The bread is not good." but that is a different sentence.
Here we have the "to je/je to" construction where TO stays for all genders, numbers and persons and means this/that/it.