Cheese and Margarine are high in fat and when implementing a calorie controlled diet, especially a restrictive diet, these foods can go by the way side and get left out.
A calorie controlled diet, is a well respected technique to induce weight loss. However, the amount of calories consumed may not be the only factor affecting purposeful weight loss. Through past, and present research it is becoming apparent that calcium may have a role in weight reduction programs.
While both cheese and margarine contain dairy, they are also good sources of Vitamin D. As you may or may not know, Vitamin D is essential to the body's ability to absorb calcium. This is an important point when considering the foods you eat to encourage weight loss, when there is evidence to suggest that dairy products could play a significant role in weight loss programs.
For a single slice of cheddar cheese, you will be consuming 117 calories. For a 14 g tablespoon of margarine, you will be consuming 87 calories. The calorie content of these foods make them expensive in terms of a calorie controlled diet. If you consume the low fat or non-fat alternatives, you will be consuming much less calories. Essentially, though the high calorie content of margarine and cheese has meant that it is often left out of the diet.
Leaving foods such as cheese and margarine out of the diet, not only means that you could be inadvertently missing out on the potential power of calcium to affect lipolysis to reduce adipose tissue[1], but it also means that your body may not be receiving essential vitamin D which helps to maintain healthy bones and teeth and prevents rickets (leg deformities such as bowed legs - fairly rare conditions).
So while it's important to keep a lid on the calories you consume each day, it's also important to get atleast the minimum requirement of vitamins and minerals that your body requires.
So in my view, making sure that cheese and margarine have a place in diets for weight loss is important to make sure that you are not only getting enough calcium, but also to make sure that your body is able to absorb this calcium through vitamin D.
References
[1] Zemel, M.B. Role of calcium and dairy products in energy partitioning and weight management. American Journal of Clinical Nutrition, Vol. 79 No. 5, 907S-912S, May 2004. Full Text
Calorie counts for cheese and margarine were obtained from NutritionData