remove indentation after opening EOF:
#!/bin/bash
create_file () {
cat > a.txt <<EOF
0 abc def
ghi jkl mno
pqrs tuv wxyz
EOF
}
create_file
Bash looks for the same "delimiter" that you started with. You started with "EOF", but was ending with "____EOF" when using indentation, so it couldn't match closing delimiter