I went for a walk because it was such a wonderful day.

is correct.


The first is correct:

…it was such a wonderful day.

The others are not correct. Generally, when used with a singular countable noun, such should come before the indefinite article, like your example:

It was such a wonderful day.

When used with a plural noun, or an uncountable noun, then there’s no article, but it should still precede any adjectives (and there should usually be some adjective(s); without an adjective, this use is generally somewhat poetic/archaic):

He sings such beautiful songs!  She listens to such horrible music.  There was such merriment at the party last night…

It should never follow a, or be used with the; all the following are wrong:

*…a such wonderful day…       *…the such wonderful day…       *…such the wonderful day…


When using such with a singular noun, put such before 'a'. This is a general rule.

Examples:

She's such a lovely person (NOT a such lovely person).

I doubt if such a promise has any value.