It was a gesture to get her to stop crying.
That is the whole of it. Sonic handing Amy a rose is a small, kind moment rather than a declaration — he is comforting her, not making a romantic commitment.
It fits the running joke of their dynamic, too. Amy's affection is enthusiastic and largely one-sided, and Sonic's response is usually to be gentle but evasive. A flower offered to end the tears is very much in character for that.