"What beautiful weather!" is correct.
"What a beautiful weather" is incorrect.
It has to do with which words are "countable" or "uncountable" nouns. Here are some other examples. In every case, √ means "correct" and X means "incorrect."
√ Oh, what a beautiful morning! Oh, what a beautiful day!
X Oh, what beautiful morning! Oh, what beautiful day!
√ Oh, what fun it is to ride in a one-horse open sleigh.
X Oh, what a fun it is to ride in a one-horse open sleigh.
√ That is a spectacular sunset!
X That is spectacular sunset!
√ That is very clear water.
X That is a very clear water.
√ That is a very clear lake.
X That is very clear lake.