Try using the writecell() function. As far as I can tell, although a TextArea's Value can be set in numerous different formats, when used as an output it always emerges as a cell array of character arrays (one line in each cell). writecell() turns this straight back into a multiline text file. Adapting Siriniharika Katukam's answer:
value = app.TextArea.Value; % Value entered in textArea
writecell(value, 'a.txt', 'QuoteStrings',false);
Matlab's documentation suggests that QuoteStrings is false by default; I found that it was true by default so you need to turn it off.