2 Answers
2

It is the last of the 613 mitzvot (commandments). As R Jack Abramowitz describes it

The last of the 613 mitzvos is the obligation for every man to write a
sefer Torah. Recognizing that not every individual possesses the
requisite skill to do so himself, one may employ another person to do
so on his behalf. Nowadays, it’s very common for people to sponsor
letters, words or verses when their shul commissions a Torah scroll to
be written. In this way, people can participate in the performance of
this mitzvah.

The reason for this mitzvah is to help spread Torah. If everybody
fulfilled this mitzvah, everyone would have a Torah – think how
well-versed people could be! Our verse says, “Write for yourselves
this song” – that is, the Torah – “and teach it to the children of
Israel.” It’s not enough merely to write a Torah and leave it in a
closet; it was meant to be taught!

A person is obligated in this mitzvah even if he inherited a sefer
Torah from his father. While the mitzvah is specifically to write a
Torah scroll, every person should strive to acquire and to study other
books of Torah knowledge.

This mitzvah applies to men in all times and places. It is discussed
in the Talmud in the tractates of Sanhedrin (21b), Baba Basra
(13b-14b) and Menachos (30a-b). It is codified in the Shulchan Aruch
in Yoreh Deah 274. This mitzvah is #18 of the 248 positive mitzvos in
the Rambam’s Sefer HaMitzvos and #15 of the 77 positive mitzvos that
can be observed today as listed in the Chofetz Chaim’s Sefer HaMitzvos
HaKatzar.

The question is highly perceptive. As this reference shows the matter is a source of discussion which Maimonides explains.

The 613th mitzvah of the Torah is the obligation for every Jew to
write a Torah scroll. In the words of the verse: "And now, write for
yourselves this song, and teach it to the Children of Israel. Place it
into their mouths, in order that this song will be for Me as a witness
for the children of Israel."

Although Rashi and some other commentaries understand this as a
command only to write the Torah portion that immediately follows,
Ha'azinu (which is referred to as a song), the Talmud understands it
as an obligation to write the entire Torah.

Maimonides explains that although the word "song" in the verse is
referring to Ha'azinu, since it is forbidden to write only a single
portion of the Torah on a scroll, it is understood that there is an
obligation to write the entire Torah.

Thank you Avrohom for your edit and for your answer. I find both concise and you provide answer to why Rambam said what he said. May I ask where it is forbidden to write only a single portion of the Torah on a scroll?
– user2411May 22 '16 at 22:50