If you are learning or playing jazz on the piano, then the answer to how important is it to play a piece of music as written, is an easy question. The answer is that it is not important. Jazz music values improvisation and reinterpreting pieces of music. Exploration and adaption of keys, chords, notes and rhythms are the hallmarks of an experienced jazz musician. I am not an experienced jazz musician, but my thoughts are that there would only be 2 reasons why following the music precisely is important. The first reason is when a student of jazz piano is told to play the music exactly by their teacher and the other reason is for a performance when it is someone else is directing how the piece of music is going to be played.
When it comes to popular or modern music, it does not matter at all if you don’t follow the music exactly as written. This is because when you purchase a popular or modern piece of music, the actual written notation is not what the composer or composers wrote down – it is someone else’s interpretation of what the music is likely to be. In my opinion, modern music is meant to be tinkered with. In my experience, I find some elements of the printed music very accurate, so I will reproduce those parts as close to the written music as possible. Other parts of the print music I find atrocious and I will just use those parts as a guide, not a prescription.
As far as classical music is concerned, it is considered very important to follow and play the music as close to the written music as you possibly can. It is important when you are learning classical piano, it is important for classical piano exams and it is considered very important for classical performances. However, there are some rare occasions when someone’s interpretation has been allowed in performances.
But what about you? What if you liked classical music but would love to improvise or alter the original, would that be allowable? Well my answer is this: If you want to change or improvise any classical music, then I think you should, especially if it is purely for your own enjoyment. Change any part that you like, as long as it still sounds good. If you asked other piano teachers or classical musicians, you might get a different answer. Just because the accepted way is to read the music precisely, doesn’t mean you cannot be unorthodox.
As far as I’m concerned, you can change or alter any music you like to suit your purposes and taste.