If the search engines can find the page those links are on and are not told to ignore those pages, they will index them like any other web document. <speculation>In your specific case they probably found them when the user went to view them. Either the browser or an extension in the browser sent tha information to Google and they then crawled those pages.</speculation>
If you do not want them indexed, and would like them to be removed, you need to tell the search engines to block them. There are several ways to do this:
1) Use robots.txt
2) Use meta tags
<meta name="robots" content="noindex, nofollow">
3) Use http headers
Header set x-robots-tag: noindex
4) Use rel="nofollow"
<a href="http://www.example.com/sample.html" rel="nofollow">Link to page I don't want indexed</a>
5) Place the content behind a login. Search engines (generally) do not
submit forms nor create accounts at websites.
6) Block the bots of all of the major search engines using .htaccess
but that would be tedious and prone to error if they change whatever
it is you would use to identify them (e.g. ip address, user agent).