It's just a common term used in that context. Maybe because it's considered a bit spicy or provocative, like the taste of a lemon.
Well, the name 'lemon' for sexy fanfiction likely originated from some sort of cultural or online subculture. It's become a kind of code or label. But the exact reason for its emergence is hard to pin down precisely.
The term 'lemon' for sexy fanfiction is sort of an informal and perhaps somewhat arbitrary label. It might have started as a random choice that caught on and became widely accepted within certain fanfiction communities.