The term "favorite" (British English: favourite) can be served as a noun or as an adjective, as referred to:
http://www.wordreference.com/definition/favorite
When it functions as a noun, it is not necessary to repeat itself to cause redundancy, as seen in your first given example.
On the other hand, for your second given example, it already shows how the term functions as an adjective -- to describe the complement "food", in which the combined term, "favorite food", describes the subject "hamburger" as your preferred source of nourishment.
Good day. / 祝 是日安好。
---
[The following reply is based on the later comment given by the question poser under her original question.]
In my personal point of view, if you say "Apple is my favourite fruit", it may be interpreted as you are in favorite of just one apple or one particular apple. Thus, in English, plural form is usually adopted in a countable noun to indicate its collective form. For the second example, if you refer to the following definition available online,
http://www.wordreference.com/definition/hamburger
the term "hamburger" may mean two things: 1) ground beef (beef that has been grinded into mashes); 2) a bun containing a slice of fried ground beef. Therefore, the speaker possibly wants to express his/her preferred food as simply the ground beef, which is uncountable, instead of a bun. However, should this mean the latter, I would say that we should still use the plural form for "hamburger".
However, there is also a grammatical concern. When the verb "to be" is used, general practice is to balance the numeral (singular or plural) between the two sides, i.e., the subject and the complement. Hence, "Apples are my favourite fruits" (with "fruits" as a collective noun of different kinds of fruit) tend to be better in terms of writing. For the second one, I would tend to use "Hamburgers are one of my favorite food" to avoid confusion that the term "food" is indeed a collective noun.