Looking at the story carefully, we see that the "crime" that the young man was accused of was actually loving the daughter of the king. It was only the discovery of the relationship between the daughter of the king and the young man that brought about this accusation. For us, this "crime" seems rather unfair as it is not actually a crime, but the text is careful to tell us why this was regarded as a crime in this particular time:
Never before had such a case occurred; never before had a subject dared to love the daughter of a king. In after-years such things became commonplace enough; but then they were, in no slight degree, novel and startling.
Thus, from this quote, the precise nature of the crime that the young man is accused of is falling in love with somebody that was regarded as socially being his superior. We can see from the quote that "daring" to love the daughter of the ruler was an unheard of event, and was regarded as a crime because persumably the king was the one to decide who would marry his daughter.