But it's not always true. You would be expected to use standard English when speaking in school and during university tutorials and various other places. And if you're emailing a friend, you can write in pretty much whatever usage you like. You have a right to use whatever language is most comfortable to you, as long as you realise that communication is a two-street. If your mother-tongue is Jamaican creole or AAVE, or some other non-Standard variety of English, you can still write poems and novels in that variety, but your readership will be small.
Usually, when you are speaking, you are talking to a group of people who understand your dialect and there are no problems. When you write something, it is often (but not always) intended for a wider audience. If you want to be understood by the most number of people, you'd write in a Standard language (whether it's English or any other language).
There is also the factor of attitudes and prejudices towards non-standard languages (not just English) whether these are well-founded or not. Some people will simply not read you if you write in non-standard language (and are able to write in a standard language) because it places an undue burden on the reader in trying to understand the dialect. It might be interesting linguistically, but if they're just reading for information, many won't make the effort.
That is one answer, I hope others will have other opinions.