First of all, Rema adds in Orach Chayim 490:9 that we read Ruth on Shavuot. Here Magen Avraham quotes Yalkut Shimoni on Ruth (596 at the end):
מה ענין רות אצל עצרת, שנקראת בזמן מתן תורה? ללמדך שלא נתנה תורה אלא על ידי יסורין ועוני וכו'
What is the connection between Ruth and Atzeret, so that it is read on Atzeret, the time of the giving of the Torah? To teach you that the Torah is only given through suffering and poverty.
Translation from this great article by Zvi Ron, kindly suggested by DoubleAA
This is in turn comes from the beginning of Ruth Zuta, an earlier midrash. However, the most practical reason is that the story takes place during wheat harvest (Ruth 2:23), and Shavuot was the festival of this agricultural event.
Many other interesting things are listed on this Chabad site:
The last verses show (Ruth 4:17), how King David descended from Ruth. Yerushalmi Chagigah 2:3 says in the gemara of the third halakhah that he died on Shavuot (א"ר יוסי בי רבי בון דוד מת בעצרת), and we know from the case of Moses that the most righteous people's years are completed, and they die on the day, when they were born (Rosh Hashanah 11a, Kiddushin 38a). So we read the Book of Ruth in King David's honour.
The numerical value of Ruth's name is 606 (תר"ו). This alludes to the 606 additional laws that we received at Sinai in addition to the 7 Noachide laws. Ruth accepted upon herself these mitzvot as well when she converted.
Ruth's case shows us, how important is the Oral Law that we also received on Shavuot. From Devarim 23:4 we may mistakenly infer that Amonites and Moabites can't marry Jews at all. However, Yevamot 69a makes it clear that it only refers to males and not to women (דאמר מר עמוני ולא עמונית מואבי ולא מואבית).