Because Flandre was a good girl, she knew herself is dangerous and wanted to die, probably from accidentally killing too many dear friends. However, Remilia hadn't had the heart to do it, so she kept Flandre in the basement, while using her ability of control fate to change that fact. While she was at it, nearly found the way, Sakuya tripped and the hot tea flew at Remilia, thus startled the vampire.So now Flandre is mentally damaged and Sakuya's main job is cleaning the house.
Tbh, the Flan thing in the basement is pretty much explained in her biography that both ZUN and Akyu has given her. So as to WHY she's in the basement should known already if you do a bit of research.