3 Nephi 12:42 Give to him that asketh thee, and from him that would borrow of thee turn thou not away.
This does not mean "give to the poor." This means "give to him that asketh thee," or, as rendered in Luke 6:30, "give to every man that asketh of thee." It does not mean to give only the deserving, it does not mean to give to just some, it does not mean to give to most, but instead it means to give to all who ask.
This, on the other hand, means give to the poor.
3 Nephi 13
1 Verily, verily, I say that I would that ye should do alms unto the poor; but take heed that ye do not your alms before men to be seen of them; otherwise ye have no reward of your Father who is in heaven.
2 Therefore, when ye shall do your alms do not sound a trumpet before you, as will hypocrites do in the synagogues and in the streets, that they may have glory of men. Verily I say unto you, they have their reward.
3 But when thou doest alms let not thy left hand know what thy right hand doeth;
4 That thine alms may be in secret; and thy Father who seeth in secret, himself shall reward thee openly.
So both are commanded: giving to all who ask, as well as giving to beggars, who may not ask you directly, let's say, but might be holding up a sign or something.
The reason why people do not keep the first commandment, to give to every man that asks, is because they have their security, their trust, in their substance, and not in God. These have received their comforter.
The reason why people do not keep the second commandment, to do alms unto the poor, is the same, and also coupled with a judgement against the beggar in his petition, which judgement is performed that they may withhold their substance and appear justified (for example, "He has made poor life choices to bring him to his current state, such as indulging in drink or drugs or other investments I disapprove of, or shall sin with my substance by so indulging, so I should withhold lest I injure him through giving him what he asks for. It's for his own good!"). As Benjamin says, those who perform this judgement have no interest in the kingdom of God, and if they do not repent shall perish forever with their substance.
But to those who hear his words, Christ says this.
3 Nephi 13
19 Lay not up for yourselves treasures upon earth, where moth and rust doth corrupt, and thieves break through and steal;
20 But lay up for yourselves treasures in heaven, where neither moth nor rust doth corrupt, and where thieves do not break through nor steal.
21 For where your treasure is, there will your heart be also.
Treasures upon earth are precisely those things that can be corrupted or stolen. Anything made out of the substance of this world qualifies. Even digits in a bank account.
Why does laying up treasures for oneself upon earth break the law of God?
By definition when you lay up treasures for yourself upon earth, you are withholding your treasures from others, therefore you do not love, and are not loving, others as yourself.
No retirement funds, no savings bonds, no Roth IRAs, no 401Ks, no nothing. Our confidence, trust, and faith must be in God, and not in the perishable substance of this world, neither in men, or we shall perish with them.
I have written a short explanatory essay on the concept of private property on my secondary blog, where I treat things that I find interesting. Be warned: as those who know me in real life may attest, I deploy vulgar language to make my points, and I am not a fan of modern political ideologies. If you can tolerate four-letter words and vulgar references to bodily functions, then read on: Private Property.
I love that man better who swears [curses, uses vulgarity] a stream as long as my arm yet deals justice to his neighbors and mercifully deals his substance to the poor, than the long, smooth-faced hypocrite. - Joseph Smith, TPJS p. 303