Mathematical music theory concerning melodic intervals and chord progressions There are many books exploring musical theory with maths. However, so far I have only seen discussions about the consonance/dissonance of two notes played simultaneously (intervals) -- this is the theory of "the vertical" on the score. Such theories only consider the sound of the frequency domain at a time, but in reality, music keeps on changing its frequency. None of the books I have read address the issue of "horizontal" movements where the music moves from one note to another, changing the spectrum of frequencies of sounds. 
Examples of "horizontal movement":


*

*Why some dissonant chords tend to resolve into consonant chords (usually by step)? Theories I have seen do a good job at explaining why something is dissonant, but none of them explain why I need to resolve it.

*Why melodies tend to move mostly by steps?


Are there any books that discuss those issues?

Your question is much more related with the realm of perception of notes and classical music theory than mathematics. 
For musical note sequences (lines) not having too large an interval between notes: This has to do with perceptual grouping strategies our brain employs. If jumps are too large they are not perceived as belonging together, breaking a "gestalt". A good book to get an introduction and many good sound examples is Music, Cognition, and Computerized Sound.
The question of "dissonant to consonant" resolution is part of western music theory and in particular harmony theory and it is not at all shown to be universal. That said, a good albeit very detailed article discussing consonance/dissonance from both a western music theory and a psychological perspective is Parncutt and Hair.
For "horizontal" changes in spectral information of musical sound, google for "transients" and "onset" and you will find a wealth of literature studying those phenomena on sound signals.
