The boys, who were conceived during a brief relationship in 2007, had their birth certificates registered bearing their mother's surname.
Federal Magistrate Janet Terry dismissed the bid for a name change after the father's lawyer argued it was "important for their sense of identity'' and was "right and proper'' they carry his name.
In handing down her decision, she also rejected the father's claims the mother told him "we can always change it later'' after they both signed the children's birth certificates following a paternity test which he insisted the mother undergo after the boys' birth in 2008.
According to the judgment, the father claimed the mother was opposed to the use of his name, as she was concerned about the children being teased at school about his name.
The Family Law Act prohibits The Courier-Mail from publishing the names of the father and mother, who are known by pseudonyms "Mr Gaynor'' and "Ms Scaife'' in the judgment.
Magistrate Terry said the father had requested the children be known as "Scaife-Gaynor'' or "Gaynor-Scaife'' or "even by an unhyphenated name''.
But she said she did not consider that she should change the children's surname just because she could. She also rejected the suggestion that there was "an expectation in 21st century Australia'' that a child bear their father's surname.
"The flaw in the argument that a child needs to have a parent's surname as part of theirs in order to prevent a confusion about identity or cement a relationship with a parent is readily exposed when one considers that no one would dream of suggesting that the millions of Australian children who were given their father's surname in the 19th and 20th centuries had as a result a less than satisfactory relationship with their mother and their maternal extended family or were confused about their identity,'' Magistrate Terry said.
"This is not a case where the mother failed to name the father on the children's birth certificate and rode roughshod over him by giving the children her surname.''
Equal shared parental responsibility was granted to the parents, but the boys will remain living with their mother and spend every second weekend with their father.
The parents have been ordered to "urgently'' attend a course on parenting after separation.