Simple question I've yet not found a definitive answer. What's the point of having sharps and flats in music theory?

Well actually that's pretty obvious question if looked from theoretical point of view (ie. moving to smaller increments of fraction from tonic creates dissonance), but I decided to go for that, because I was having hard time paraphrasing this question in a way I meant it. (If that makes any sense?)

I used to have hard time trying to understand music when starting to play until I went down to the very basics: Notes being simply a certain fraction off from tonic that creates the unique tonality of notes and harmonics. That's simple to understand and "unlocked" the idea behind chords, scales and their relationship.

On string instrument that's easy to see, because notes are laid out in logical order. That's the way I learned to play what I can play these days. Never really need to think sharps or flats; they're all just notes and sound different due to their relation to tonic. Rest is just practice how to use them.

It's only turned problematic when I've tried to play with keys. I can't play a thing with those instruments; white and black keys throw me off and I don't know which I should use.

Why does note certain fraction from tonic should be called flat or sharp instead of just a note? Just because it sounds certain way and is further from the "perfect" fractions of the given frequency, or is there something I have missed?