Hello and welcome to the forum! I just wanted to say, that I have the same stamp in my passport from one instance of visiting my (then) fiance (now) husband a while back. After a particularly grueling interrogation, they let me in by the skin of my teeth and put that stamp in that had what I now believe is a reference number. Basically, I was told it was just the record of your interview and subsequent admittance into the UK filed away under this reference number for easy access for them to review in future if needs be. So as long as you were 100% honest, I wouldn't be concerned for the future (apart from the visiting back and forth, which in future you will probably want to get a visitor visa approved ahead of time).
And FYI in regards to future visa/immigration woes, I had no issues with having this in my passport when I applied for my spousal settlement visa--it was issued in about 2 days with the expedited service.