This is an interesting problem and I think I got a solution for you.
Speed is the difference in position per time interval.
This means that if you can measure travel distance and time, you can measure speed.
It turns out that you can indeed track both distance and time as follows:
/scoreboard objectives add travelDistance stat.aviateOneCm
This scoreboard objective keeps track of how many centimeters you have flown. Now you need to keep track of the time. This can either be using redstone or a scoreboard timer. I leave it up to you to design that, since it is out of the scope of this question.
Now you need an additional objective to write the speed to.
/scoreboard objectives add speed dummy Speed
Following commands should be repeated every second, using your timer:
/execute @a ~ ~ ~ scoreboard players operation @s speed = @s travelDistance
/scoreboard players set @a travelDistance 0
If you repeatedly execute these last two commands, then you get the distance in centimeters that the player travels within the specified timeinterval. That's exactly the definition of speed!
Make sure that you display the Speed scoreboard in the sidebar and you're set!