Good question. You’re right- if a mutation occurs in meiosis the gamete (egg or sperm) that is produced will be carrying a mutation that could form an embryo, and so the child will have this mutation in all of their cells and will have the disease, and can therefore pass it on to their children. If a spontaneous mutation occurs in a non-sex cell during development, it will only cause disease in the individual and not be passed on. Some diseases require one copy of the faulty gene, so if one of the parents has the genetically inherited disease, the child will definitely have the disease. Some require two (they are recessive) and so if one parent is carrying one copy and the other parent has no copies of the faulty gene, the child could inherit the faulty version and be a carrier, but not have the disease. There are also some diseases that have lots and lots of mutations in genes that might contribute to a risk of a disease but the person is not 100% sure to get it. This is true for lots of cancers, diabetes, and some dementias. I hope this answers your question!
Don’t forget about bacteria and viruses. Many illnesses are caused by an infection rather than a mutation. While a mother can pass these to her child it does not happen because they share genetics. Some viruses can also lead to cancers under certain conditions. Cancer is something that we associate with DNA mutations and can indeed be inherited from a parent with a faulty gene but in this case the mutation is caused by the virus instead.