What was the recipe that called for it? Cost may be a factor. Sometimes Crisco or lard is called for in some recipes dealing with baking because of ceratin properties or moisture content. Margerine is hydrogenated vegetable oil and water usually- and generally is inferior to butter for cooking applications.
A lot of margarines are less healthy than butter, due to manufactured, chemically altered trans fats. If the recipes are coming from some corporate 'kitchen' you may see specific brands for the various ingredients listed, marketing being the primary concern over health, nutrition and flavor.
In my opinion butter is in general better tasting and more workable in recipes that call for margarine. Butter may have a higher fat content but it is a natural fat more easily processed by our bodies than the hydrogenated oils found in margarine.
Food nourishes my body. Cooking nourishes my soul.
Paul Prudhomme used to use margarine over butter in a number of preparations, primarily when he wanted greater oiliness and resistance to burning. I find that if extra oiliness is actually desirable, I can replace margarine with 3/4 butter and 1/4 canola oil. This of course isn't any more resistant to burning than just butter, but I've never found it to be a problem. Usually I just replace 1:1.
Taste wise Butter is superior. Margarine is cheaper
Are they interchangeable ??yes and no whipped margarine contains nearly 1 1/2 times the water as regular margarine and contains artificial color and flavor and who knows what else. Solid margarine is almost interchangeable with butter as less moisture content. Butter will give better color in baked goods and better flavor. Most margarines have higher smoking point then butter.Both have about same amount of calories.
A lot might have to do with when the recipe was created. In the early part of the 20th century many people converted to margarine because it was more "shelf stable", was easier to get in urban areas, and was considered healthier than butter. My grandfather, who lived in rural Indiana (corn growing and dairy area) always prefered oleo (margarine) over butter because that is what he was fed as a kid. And in the 70's and 80's margarine was considered much more healthy than butter so many recipes were created using the "healtier" choice. Today we have a much different view of margarine.
Some of the recipes that had margarine as ingredients were: Macaroni Grill Focaccia, Papa John's Garlic Sauce, Carrot souffle, pizza hut cavatini pasta, popeye's buscuits, Buffalo wings (do not use butter! ), baby ruth bars, steak and ale burgundy mushrooms, tgif veggie fajitas, famous amos cookies. Could it only be a cost issue?
Many of the chain type things you are addressing use a liquid form of margarine made with tropical oils. Brands are Whirl, Butter-it, Whipit,,. They were used for grill or shallow fat frying. It does work on wings..Garlic sauce in most pizza places use it. Closest thing retail is I cant believe its butter spray.
I can't believe how scary margarine has become to me. It makes me wonder how my health can unknowingly be compromised by large corporations who make food taste good by using lab created ingredients for the sake of shareholder value.