In tractate Sanhedrin 46a, the Talmud explicitly prohibits having relations in public. This source prohibits a couple from performing an act which would be halachically legitimate in their own home. Though we do not find explicit prohibitions on other acts such as hugging and kissing in public, this Talmudic passage implies that certain actions which are permitted (even desirable) in the privacy of one's own home could be entirely inappropriate outside one's home.
It remains difficult to determine the exact halachic parameters for the conduct of a couple in public. Much of what is acceptable depends on the standards prevalent in a given community. Therefore, rabbis disagree on specific guidelines regarding different displays of affection in public.
The rabbinic supervisor of this site, Rabbi Yehuda Henkin, has written that holding hands in public is a neutral sign of affection and is thus permissible. That permission would also extend to typically chaste familial kissing. Other, more intimate behaviors, such as hugs or kisses that imply a sexual relationship, are prohibited, based on the Talmudic passage in Bava Batra 58a concerning Abraham lying with his head in Sarah's lap.
Rav Henkin's views can be found in Responsa Benei Banim I:37:(1). There, he explicitly addresses the Rema in question, noting its sources in the aforementioned Talmudic passage and explaining that it does not present a prohibition.