Why does the Torah place this Parshah here?
Rashi #1: Because when Hakadosh-Baruch-Hu told Moshe to give the Bnos Tzelofchad their portion of inheritance, he understood that Hashem was instructing him personally to do so, which in turn, implied that He had cancelled the decree prohibiting him from entering Eretz Yisrael. So Hashem informed him that the decree was still in place.
Rashi: It can be compared to a king who forbade his son to enter the throne-room. When he entered the outer gate, the son followed him; the hall, the son followed him. But when the son attempted to enter the throne-room, the king told him that from now on, he was forbidden to proceed.
Why does the Parshah appears here and not at the end of Chukas? - See Sifsei Chachamim).
Why did Moshe not carry out Hashem's instructions immediately?
Ramban, Moshav Zekenim: Because Hashem did not intend him to. He was merely informing him that he would not be the one to distribute Eretz Yisrael, 1 because he would only merit seeing the land but not entering it. 2