Yes. There are some very good reasons for the coffee stains you have observed.
Mishnah Mikvaot 6:5:
קפה מטבילין בהן כמה
Coffee, we dip much in to it.
Obviously, this will cause the coffee to overflow the cup and will result in stains.
Mishnah Shabbat 4:2:
קפה מטה על צדה
Coffee, we tip on its side.
Clearly, this is going to produce even more stains.
However, we can pose a question from Mishnah Beitzah 4:1:
לא יפשיל את הקפה לאחוריו אבל מביאה הוא בידו
One must not throw the coffee behind him, but rather bring it in his hand.
This Mishnah rules that we must be very careful when transporting coffee, to avoid stains.
We can resolve the contradiction by positing that the obligation to spill coffee is only in public spaces. In one's home, one is meant to avoid doing so.
Support for this distinction can be seen from Shulchan Aruch Yoreh De'ah 181:6:
אשה אינה במצות הקפה
Women do not have the commandment of [spilling] the coffee.
Now, if the obligation to spill coffee applied at home, women would be included. However, because it only applies in the beit midrash, women are exempt. As we learn in Mo'ed Katan 18a:
אשה בי מדרשא לא שכיחא
Women are not commonly in the beit midrash.
(The fact that you also see some stains in private books is probably because not all of the masses are aware that this distinction exists - they see coffee stains in the beit hamidrash and mistakenly believe that they should also practice this at home.)