Fast food is generally considered unhealthy because it's "ultra-processed", has excess fat, carbohydrates, sugar, and salt, and sometimes uses lower-quality ingredients. If you make the same food at home, you are very likely using less fat and sugar and fresher, less processed ingredients; but if not, it may actually be less healthy than fast food.
Fast food companies prioritize making their food palatable, cheap, and easy to mass-produce and cook. They don't prioritize making the food healthy. Extra fat and sugar generally make the food more palatable, but directly contribute to diabetes, obesity, heart disease, and other ill-health (which is not to say that one teaspoon of added sugar will make you fat and sick...but too much, too frequently makes it much more likely). Extra sugar and salt make the food shelf-stable, but too much salt can lead to dehydration and high cholesterol. Extra processing makes the food more palatable, cheaper, and shelf-stable, but has been shown in numerous studies to strongly correlate with obesity when consumed often. Not only does the food have extra fat and sugar, it also misses key nutrients which are present in vegetables (not common in fast food places) and destroyed by the various methods of cooking like frying.
Fast-food companies use ultra-processed ingredients like "lean finely textured beef" (LFTB), partially-hydrogenated vegetable oils, and corn syrup. They add extra fat to dishes by frying most of them and choosing fattier meats and adding extra oil, butter, or even lard. They add sugar to typically savory dishes and foods like bread, and add more sugar than most people would expect to sweet dishes. They "sneak" fat, sugar, and salt in dishes like the salad dressing in salad. Of course not all fast foods are ultra-processed and high in fat and sugar: a grilled sandwich or salad with dressing on the side are probably not going to be ultra-processed or excess in calories even in fast food. But the typical fast food items like cheeseburgers, french fries, and fried chicken - even when made at home - are all heavily processed and loaded in fat, carbohydrates, and salt.
Also note that most fast food locations are franchised, and the franchise owners sometimes cut corners such as leaving food on burner plates and reusing dropped food. Though this is actually less of an issue than some may suspect, as there are rigorous food safety inspections and the companies themselves work hard to ensure safety to avoid lawsuits. Nonetheless, cooking the food at home gives you complete control, so you can ensure that you are following sanitary standards.
If you make food at home, you are likely using a lot less oil and sugar than fast food places, and probably not using ultra-processed ingredients like LFTB and high-fructose corn syrup as they aren't sold in stores. You also may be using whole foods (fresh or even frozen meat and vegetables), which are more expensive, but contain key nutrients not present in fast food, and shown to lead to better health. Let me know if you would like more information on what foods are considered "healthy" or would like to see some good recipes.
For more info see Harvard University Article and Wikipedia's Critisism (it's important to have trusted sources when researching dietary info, as there is a lot of bias and misinformation)