The Importance of Halal Sustenance
There is no doubt that one of the obligations upon the Muslim is that he earn for himself and his family a pure and halal sustenance. Abu Hurayrah narrated that the Prophet (SAWl) said:
Then the Prophet (SAW) mentioned a traveller on a long journey, who is dishevelled and dusty, and he stretches forth his hands to the sky, saying, "O my Lord! O my Lord!" - while his food is unlawful, his drink is unlawful, his clothing is unlawful, and he is nourished unlawfully; how can he (expect to) be answered? It is noticed in this hadith that the Prophet (SAW) emphasised this person's impure earnings by detailing the fact that his food, clothes, drink and nourishment were all obtained from the impure.
From this hadith, we learn that both the prophets and the believers have been commanded to eat from the tayyibdt, or the pure things. Purity is achieved when one earns his sustenance in a halal manner, and then uses it to buy halal food. So, if a person buys pure food from stolen money, this will not be accepted from him. Likewise, if one earns money from permissible means, then uses it to buy impermissible items, such as intoxicants, this too will not be accepted from him. Only when both of these conditions have been met - the way one earns money and the way one spends it - will Allah's acceptance be gained.
Another hadith affirms the above:
So charity that is given from impure earnings will not be accepted by Allah, no matter how much is given, whereas charity given from pure earnings will be accepted by Allah, even if equivalent to a date!
Furthermore, there are a number of narrations that signify that earning through halal is an obligation upon every Muslim. It is because of this that Islam encourages working. The taking of a profession is encouraged because it is one of the best ways that a person can ensure earning pure sustenance. Umar ibn al-Khattab said,
So great is the status of halal sustenance that Islam has not looked down upon manual labour. Instead, it has given it a very high place, due to the fact that manual labour is, in general, a very honest profession. The Prophet (SAW|) stated,
In this hadith, we are told that the most honourable way to earn money is through manual labour, for even the Prophet Dawud would earn his sustenance by making armour and selling it. Furthermore, the Prophet (SAW) said,
This great Prophet of Allah, who took care of Maryam the mother of Isa, used to earn his livelihood through the noble profession of carpentry.
In fact, even the Prophet of Allah(SAW) used to earn from his own hands. Once, he (SAW) stated,
So the companions asked, "Including you, O Messenger of Allah?" He replied,
The Prophet (SAW) was not embarrassed or ashamed to inform his companions that he used to work as a shepherd in return for a very small amount of money (qararit).
As mentioned earlier, there are two aspects to halal sustenance, the first involving earning through halal means (as discussed above), and the second entailing spending only on halal items so as to ensure purity in what a person eats, drinks and is nourished on.
On another occasion, the Prophet (SAW) could not sleep all night, tossing and turning. So his wife asked him, "O Messenger of Allah! You spent the night awake, tossing and turning?" He replied,
Subhan Allah! The Prophet (SAW|) ate one date, forgetting that he had some dates in his house that were meant to be distributed to the poor, and this caused him to have a sleepless night for fear that it might have been from the dates of charity! So how is it that this accidental morsel, which a person would hope to have been forgiven on the basis of innocent intention even had it been haram, caused our beloved Prophet (SAW) so much unrest and discomfort, while one of us might earn his or her entire living through means that are haram without a doubt, and yet still enjoy a deep sleep at night?
The Companions, too, were careful about how they earned their sustenance. Once, a servant of Abu Bakr's came to him with some food, so he ate from it. The servant then asked him, "Do you know where this came from?" He replied, "From where?" The servant responded, "I practised astrology once in the times of Jahiliyyah — even though I am not an expert in it, except that I managed to trick the other person. [10 ]So he paid me, and gave me what you ate!" Hearing this, Abu Bakr put his finger in his mouth and forced himself to vomit up the food, until there was nothing left in his stomach. [11 ]A similar incident is reported from 'Umar ibn al-Khattab, when he was given some milk by his servant, and then found out that the milk was from the camels that were meant for charity. [12 ]In yet another indication of the piety of the early generations, Sa'ad ibn Abi Waqas, one of the famous Companions of the Prophet (SAW), was once asked, "Why is it that your prayers are responded to, amongst all of the other Companions?" So he replied, "I do not raise to my mouth a morsel except that I know where it came from and where it came out of." 
In conclusion, the Prophet (SAW|) gave an example contrasting the person who takes from this world excessively, not caring how he earns his money, with the person who takes from it moderately, ensuring that his earnings are halal. He (SAW) said,
In this beautiful hadith, the Prophet (SAW|) drew a parable between the one who does not care how he earns, but rather takes everything he finds, like the animal that eats from all types of crops in the spring. Spring is the season that gives crops which are generally not suitable for animals to eat. So this is an indication of a greedy person, whose only desire is to increase his or her wealth, regardless of the consequences. Such a person is never satisfied, but rather eats, and eats, and eats, until he or she is destroyed, or is almost about to be destroyed, just like the animal that eats excessively. However, the wise person chooses with care how to earn sustenance, and picks the right types of food to eat. Such a person only takes what is needed, and does not become excessively involved with earning more than the basic needs. Such a person will live a comfortable life, just like the animal that eats the right crop in moderate quantities. Furthermore, such a person will be able to earn more, when the need arises, just like this animal will be able to pasture again when it needs to. How beautiful, then, is this money when earned properly and spent properly! And how evil it is, when earned improperly, and spent improperly!
1 Reported by Ahmad (2/328), Muslim (2/703), and al-Tirmidhi (5/220) from Abu Hurayrah.
2 Reported by al-Bukhari (#1410) and others.
3 There are various wordings of this narration, one of them being, "The seeking of halal sustenance is an obligation upon the Muslim." However, none of these narrations are authentic. Some scholars, such as al-Sakhawi, consider the hadith to be hasan due to all of its weak chains (see his al-Maqasid al-Hasanah, # 801), whereas others, such as al-Albani, hold it to be weak (see al-Mishkat, # 2781). In any case, the meaning of the hadith is without a doubt correct.
4 Kanz al-Ummal, (4/123).
5 Reported by al-Bukhari (2/10) and others.
6 Reported by Muslim (# 2379) and others.
7 Reported by al-Bukhan (2/48) and others.
8 Reported by al-Bukhari (# 232) and Muslim (# 1069). It was not allowed for the Prophet (SAW|) or his family to eat from charity.
9 Reported by Ahmad in his Musnad (2/183 and 193), and considered authentic by al-Arna'ut in his checking of Sharh al-Arba in (p. 198).
10 Meaning that he was not an astrologer by profession, but pretended to be one in order to gain some money. The practice of astrology is itself a form of shirk, thus this money was tainted by the evil of astrology and the evil of cheating.
11 al-Mishkat(# 2786).
12 al-Mishkat (# 2788). It is not allowed to benefit from the animals that are given in charity unless the Muslim ruler distributes it to those that deserve it.
13 Shark al-Arbdin, p. 275.
14 A green crop that is not of the fanciest type of harvest
15 Reported by al-Bukhari (# 1465) and others.