Long story short: the officer first checked my passport, then asked me where I was coming from. I replied that he had no right to ask such question and that me not answering wouldn't be a valid reason to deny my entry. He then asked to check my boarding pass and I gave in because I didn't want to make the people behind me wait for us to have an argument.
My question is: did the officer have the right to ask where I was coming from and (even worse) to present a boarding pass? His excuse was "they changed the law last week and now we are vetting EU citizens from non-Schengen countries".