They arrest you for saying that because it's considered "use of symbols of unconstitutional and terrorist organisations"[0] – you're absolutely free to demand a single state solution under Palestinian rule, you're just not allowed to promote Hamas and their slogan.
[0] https://www.gesetze-im-internet.de/englisch_stgb/englisch_st...