He hang himself because he was afraid of the ramifications
Newport Coroner's Court heard Edward Senior's private message about the "brief relationship" was seen by hundreds of people.
The BBC reported that a complaint was made which led to Swansea University excluding him from lectures while it investigated.
Overwhelmed
The 22-year-old's body was found in a wood near his home.
Senior coroner Wendy James said: "Despite having the support of a loving family, it was not enough for him to get through a stressful period in his life.
"Not knowing what the ramifications would be, he felt isolated and became overwhelmed.
"It is not unusual for young people to make mistakes. But his biggest mistake was dwelling on that one mistake."
Inquest
The inquest heard that Mr Senior died in February after the complaint about his WhatsApp post which had been shared on Facebook was raised.
He returned to his family home in Raglan, Monmouthshire, and was said to be distraught.
On the morning before his body was found he was described as "preoccupied". The cause of death was given as hanging.