Knowledge of scales is the basis of musical theory. Scales help us navigate our way around our instrument as well as enable us to better understand notated music. Once you have learned the major and minor scale formula, you can apply that formula to any given musical key before moving on to more obscure and advanced scales.
When a musician composes music, they are at an advantage if they understand the relationship between the various notes. Scale knowledge makes it easy to select notes and note sequences that will be pleasing to the ear. Without knowledge of scales, your musical vocabulary is limited.
Hitting a note that is in the wrong key, often called a "bum" note, sounds pretty bad. But without understanding which notes work well together, it's only a matter of time before this happens. Just playing a scale repeatedly will sound boring, but scales are a great framework in which to improvise.